go – How can deploy with gclouad app engine there are golang missing package-ThrowExceptions

Exception or error: trying to deploy with gcloud app engine service but got Error type: BuildError.. locally app is building and started without an error. missing package are describe in the code example. my GOPATH is export GOPATH=/Users/xxx/Documents/projects/go-workspace. project folder is /Users/xxx/Documents/projects/go-workspace/my_project Updating service [default]…failed. ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 28d0b69a-4c0a-426b-bc25-d39649de557e status: FAILURE. …

Go parsing failing quite often (goquery)-ThrowExceptions

Exception or error: I have a Python program which check whether a product price in Amazon is lower than expected. For learning purposes, and to make it more portable, I’m porting that code to Go. It’s my first ever Go program. For parsing the html, I’m using goquery. So far I’m just trying to retrieve …

ObjectID automatically set to "0…0" in go with official mongoDB driver-ThrowExceptions

Exception or error: I’m trying to save user entries in a MongoDB database with Go. Users should get an ID automatically. I’m using the offical MongoDB Go driver. My sources were especially https://vkt.sh/go-mongodb-driver-cookbook/ and https://www.mongodb.com/blog/post/mongodb-go-driver-tutorial. Struct looks like this: type User struct { ID primitive.ObjectID `json:”_id” bson:”_id”` Fname string `json:”fname” bson:”fname”` Lname string `json:”lname” bson:”lname”` …

go – How to multiply duration by integer?-ThrowExceptions

Exception or error: To test concurrent goroutines, I added a line to a function to make it take a random time to return (up to one second) time.Sleep(rand.Int31n(1000) * time.Millisecond) However when I compiled, I got this error .\crawler.go:49: invalid operation: rand.Int31n(1000) * time.Millisecond (mismatched types int32 and time.Duration) Any ideas? How can I multiply …

go – GOPATH variable not persisting-ThrowExceptions

Exception or error: I’m setting the $GOPATH using export GOPATH=$HOME/go as per GoLang’s instructions and everything works fine. When I echo out the path it shows what I set it to. However, if I close my terminal and re-open it the $GOPATH is no longer what I set it to. I guess my question is …

go – Setting timezone globally in golang-ThrowExceptions

Exception or error: I’m trying to modify golang timezone for my application I have took a look at time package, initializing timezone happens in time/zoneinfo_unix.go @ initLocal The function simply tries to read environment variable TZ and if it’s valid it loads it and if it’s not it falls back /etc/localtime and if it’s not …