I have written a sample program to do file search, it does the search but fails at the end with fatal error: all goroutines are asleep - deadl
chromedp.Navigate(tragetUrl), chromedp.WaitVisible("#button"), chromedp.Click("#button"), Goal: if #button is not exist then reload the current page until butt
I am trying to understand how the context introduced in Golang 1.7 works and what would be the appropriate way to pass it to middleware and to a HandlerFunc. Sh
If types T1 and T2 are based on type T, and type T only comes into existence from a NewT1() or NewT2(), is there any way a function func (*T) WhoAmI() can know
Consider the following setup: go.mod module example.com/main require example.com/sub dummy replace example.com/sub => ./sub sub/go.mod module example.com/s
I want to encapsulate my golang unit testing in a docker-compose script because it depends on several external services. My application has quite a lot of depen
I tried to use 'test_structure.SaveTerraformOptions' but it doesn't save resources IDs. For example, I'm running 2 modules - Module 1 creating the networking an
I'm reading 'CreateSpace An Introduction to Programming in Go 2012' and on page 86 I found this evil magic func makeEvenGenerator() func() uint { i := uin
Here is my code which was used to transfer a byte array to string but it was failed: package main import ( "bytes" "fmt" ) type IPAddr [4]byte // TO
Could someone please explain to me the usage of << and >> in Go? I guess it is similar to some other languages.
Is there a way to specify default value in Go's function? I am trying to find this in the documentation but I can't find anything that specifies that this is ev
I have installed the Go extension (version 0.11.4) in Visual Studio Code on MacOS: However, I find that the linter does not 'pick up' functions defined in th
Is there a way howto instruct GO runtime to use larger heaps? I am running GO 1.5. My GO process is currently spending 34% of time in GC but it uses unly 1/3 o
http://play.golang.org/p/W70J4GU7nA s := []int{5, 2, 6, 3, 1, 4} sort.Reverse(sort.IntSlice(s)) fmt.Println(s) // 5, 2, 6, 3, 1, 4 It is hard to unde
I'm puzzled with dependencies. I want to be able to replace some function calls with mock ones. Here's a snippet of my code: func get_page(url string) string {
I'm setting up testing in golang. I use go-sqlmock to test mysql connection. But sqlmock.NewRows and mock.ExpectQuery does not work well with error. I want to k
I came across a situation where I want to sort a map first by value and if the values are equal then by key in GO. Here is an example of input and expected outp
I'm playing around with chromedp and been trying to replicate the functionality in puppeteer node.js but in golang. I'm finding that the same JSON payload to ch
I need to ask a question on creating UDF on aerospike. My configuration is as below: M1 Macbook Pro Docker using latest aerospike My application is running this
fmt.Println("Enter position to delete::") fmt.Scanln(&pos) new_arr := make([]int, (len(arr) - 1)) k := 0 for i := 0; i < (len(arr) - 1); { if i != p