Blog    Bookmark    Note    Photo    Password Manager    About Me    Settings    Sign out





     Golang       Apr 06, 2019   

When a client sends  an HTTPs request to a TLS server, the client verifies the server's certificate during the handshake. To do so, the client side mu  ... Read more


     Golang       Jun 15, 2018   

You can embed a struct inside another one without giving it a name. For example, type Foo struct { Bar } type Bar struct { ID string } The field Bar i  ... Read more


     Golang       Jan 10, 2018   

"Map lookup requires an equality operator, which slices do not implement. They don't implement equality because equality is not well defined on such ty  ... Read more


     Golang       Sep 20, 2017   

Golang's package expvar exp oses var iables via HTTP.  Operations on the exposed varibles are atomic. It can be used for the purpose of web page ana  ... Read more


     Golang       Apr 20, 2017   

Interface in Go is a type which provides a way to specify the behavior of objects: if something can do this, then it can be used here. So interface is  ... Read more


     Golang       Apr 20, 2017   

RPC server registers two paths ( /_goRPC_ and /debug/rpc ) and their handlers as HTTP server. The handler of /debug/rpc handles the http requests and  ... Read more


     Golang       Apr 20, 2017   

This is an example that access exported members from a unexported struct. // pk/pk.go package pk type point struct { X, Y int } func NewPoint(x,  ... Read more


     Golang       Apr 20, 2017   

1. strings.Reader func NewReader(s string) *Reader 2. bytes.Buffer implements io.Reader, io.Writer interface. func NewBuffer(buf []byte) *Buffer fun  ... Read more


     Golang       Apr 20, 2017   

func SHA1(s string) []byte { h := sha1.New() io.WriteString(h, s) v := h.Sum(nil)  ... Read more


     Golang       Apr 20, 2017   

init function is executed before main function and after all global variable declarations have evaluated (including the varibles and init functions de  ... Read more


     Golang       Mar 22, 2017   

As stated in The Effective Go : "Slices hold references to an underlying array, and if you assign one slice to another, both refer to the same array. I  ... Read more