Category "go"

Issue installing Terratest using Go Task's Yaml Azure pipeline - issue triggering terratest tests in sub-folder

I'm facing this issue while installing terratest by azure yaml pipeline : C:\hostedtoolcache\windows\go\1.17.1\x64\bin\go.exe install -v github.com/gruntwork-io

Scraping a simple website with colly in golang does not return any data

I'm trying to scrape a simple website that looks like this: <html> <head> </head> <body> <pre> "Name Surname 1 Name Su

Is there a way to convert handlebars syntax to the golang template language?

Is there a safe way to easily convert standard handlebars templating syntax to the templating syntax used in golang(e.g. {{.Lookup "Question"}})? I have a Jenki

CRC32 Checksum Calculation via GO

Trying to create a GO function that produces the same result as the Ubuntu Linux "cksum" operation, for example: $ echo 123 > /tmp/foo $ cksum /tmp/foo 23306

Go 1.18 build error on Mac: "unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable"

I upgraded to Go 1.18 on Mac 12+. 'go build' fails with errors like: # golang.org/x/sys/unix ../../gopath/pkg/mod/golang.org/x/[email protected]

How can I fix the vscode debuger in VSCode?

I'm trying to debug a simple Golang code in VSCode with dvl-dap and I get the following error: Does anybody know how can I solved this issue? I'm working from

Why there are two "require" blocks in go.mod since Go 1.17?

I've created small go application. Few days back I upgraded from go 1.15 to 1.17 and I also upgraded packages with go get -u. After the changes I have 2 require

Peeking into the top of the Priority Queue in Go?

I was trying to implement a sample program using heap, and I am able to Push and Pop from the Heap. I was able to implement the Push and Pop methods and use th

Go lang decode io.read JSON v.s. unmarshal giving different results

I have a handler like this: type Location struct { Lat float32 `json:"lat"` Lon float32 `json:"lon"` } func handleJSONLocation(res http.ResponseWriter

Build error in Go/Golang: Column does not implement gorm.ColumnType (missing AutoIncrement method)

I am facing this build error in Golang V1.17 intermittently. # gorm.io/driver/mysql ../../../../pkg/mod/gorm.io/driver/[email protected]/migrator.go:224:24: cannot u

How Can I log-in Amazon with Golang Colly

I am trying login to my amazon buyer account for getting tracking info. I made wordpress-woocommerce login and getting infos but I could not for Amazon. package

Unknown flag: --go_opt while regenerating gRPC code

I followed the gRPC quickstart document in this link https://grpc.io/docs/languages/go/quickstart/ and while regenerating the gRPC code i am getting error ( Unk

Regex catch bad octet in IP

Hi can someone explain me why last octet of the IP if 01 or 001 is not capched by this regex ? (\.?)([2-9][5-9][6-9]|[3-9][0-9][0-9]|0[0-9][0-9]?)($|\.) Debug

"go get" command not generating the bin folder when it is run in a shell script

I have installed go package. When I go to the instance(VM) and run the command go get github.com/linkedin/Burrow from a terminal/cmd it is downloading both "sr

How to get data from such blob:http:// url in golang?

I have an api written in go, which takes the input in form of blob file, actually a blob url from frontend , When the file gets uploaded to s3 it makes an empty

Recursive data structure unmarshalling gives error "cannot parse invalid wire-format data" in Go Lang Protobuf

OS and protobuf version go1.18.1 linux/amd64, github.com/golang/protobuf v1.5.2 Introduction I am trying to use recursive proto definitions. .proto file message

How to create a unique key for a map

I'm creating a structure where a developer can store a reference to something and retrieve it when needed using a reference key, but not delete the reference. H

Golang: How to color fmt.Fprintf output?

I know I can add colors to fmt.Println output with something like: package main import ( "fmt" ) func main() { colorReset := "\033[0m" colorRed :=

How to initialize a nested struct?

I cannot figure out how to initialize a nested struct. Find an example here: http://play.golang.org/p/NL6VXdHrjh package main type Configuration struct { V

How can i add enum in gorm?

I am writing PostgreSQL table schema. type TestTable struct { ID int `gorm:"column:id;primaryKey;autoIncrement"` CarType string `gorm:"colum