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
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
"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'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
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
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
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
init function is executed before main function and after all global variable declarations have evaluated (including the varibles and init functions de ... Read more
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