I need to get the current time in different time-zones. Currently I know that we can do the following: t := time.Now() fmt.Println("Location:", t.Location(),
I'm wondering why fallthrough isn't allowed in a type switch statement in golang. According to the specification: "The "fallthrough" statement is not permitted
I am experimenting using Go to interact with a Database and am running into issues when dealing with Decimal fields. In this database most fields that are bas
Sometimes, it's convenient to combine two lists into a tuple using zip built-in function in Python. How to make this similarly in Go? For example: >>>
I've got a trouble with conditional compilation in Go 1. Here is my test code. Is there anything I misunderstand about the "// +build" constraint and the "-tag
Suppose I define the following gRPC service: service Library { rpc Search(SearchBookRequest) returns (stream SearchBookResponse) {} } message SearchBookReq
I have a time.Time value obtained from time.Now() and I want to get another time which is exactly 1 month ago. I know subtracting is possible with time.Sub()
Is there an established best practice for separating unit tests and integration tests in GoLang (testify)? I have a mix of unit tests (which do not rely on any
I'm facing an issue, am trying to run my go fiber project inside docker with air but am getting this erroruni-blog | /bin/sh: 1: /app/tmpmain.exe: not found am
I have two go programs. ProgA starts ProgB using cmd.Start(). From ProgA I try to kill ProgB, but ProgB shouldn't get killed immediately, it has to do some clea
calculate the sum of squares of given integers, excluding any negatives. The first line of the input will be an integer N (1 <= N <= 100), indicating the
Using gopkg.in/mgo.v2/bson, I wonder how to marshal an interface{} value into a value of type bson.Raw. The documentation for bson.Raw states: Using this t
I usually run go test ./... to run all tests in my project. How can I set up launch.json to debug every tests that normally go test ./... runs?
I wrote a golang program, that uses 1.2GB of memory at runtime. Calling go tool pprof http://10.10.58.118:8601/debug/pprof/heap results in a dump with only 323
Let's say I have two similar types set this way : type type1 []struct { Field1 string Field2 int } type type2 []struct { Field1 string Field2 i
I have a database sql.NullBool. To unmarshal json into it, I am writing this little function. I can converty the byte array to string by simply casting it (stri
I try to write a small application in go that takes 'x' numbers of integers from standard input, calculates the mean and gives it back. I have only gotten so fa
I am looking to create a yaml file in the following format. Using Go template Custom_listeners: Config1 : config_value Config2 : config_value
I'm trying to install doozer like this: $ goinstall github.com/ha/doozer I get these errors. goinstall: os: go/build: package could not be found locally g
The struct is like this: type Node struct { Stat *Stat } type Stat struct { StatInfo []string } Initialize the structure, and set properties. node :=