For example, I have a string, consists of "sample.zip". How do I remove the ".zip" extension using strings package or other else?
I have a weird issue that arose when I took a break from this project. Upon starting up Goland, I'm riddled with errors when trying to run my project. The spe
Is there a StartsWith(str1, str2 string) function that can check if str1 is a prefix of str2 in Go language? I want a function similar to the Java's startsWith
I'm trying to debug the following build error in our CI where "A depends on B which can't build because it depends on C." I'm building my data service which doe
In Go, you can marshall a struct to XML, e.g.: package main import ( "encoding/xml" "fmt" ) type person struct { Name string Starsign str
I'm pretty new to Golang and I have an issue with adding items to Array. I use this link as a reference golang-book. I have this struct: package models type Fi
To my knowledge go distribution comes with some sort of package manager. After go 1.4.1 installation I've run go help in order to find any sub-command capable o
I'm trying to write a basic go program that calls a function on a different file, but a part of the same package. However, it returns: undefined: NewEmployee
Is there a way to download a large file using Go that will store the content directly into a file instead of storing it all in memory before writing it to a fil
Looking at the set up for go-vcr // Start our recorder r, err := recorder.New("fixtures/etcd") if err != nil { log.Fatal(err) } defer r.
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