1 answer

Go - math.MaxInt64 and Type Inference Error

I've been working on metaprogramming involving packages and I've been running into the error constant 9223372036854775807 overflows int whenever math.MaxInt64 and math.MaxUint64 show up. I've ...

1 answers | 4 mins ago by Tristan Rice on Stack Overflow
0 answers

Godoc: Generating docs for Martini

I am a Go noob and right now I'm able to generate the Godoc for all the packages in my project. I am using Martini. How can I generate automatic doc support for REST (something equivalent to yardoc or ...

1 answer

How to include 3rd party libraries in Go on AppEngine?

I want to use the pdf library I only have the GAE SDK for Go installed and nothing else. i would like to be able to do: import "" ...

1 answers | 49 mins ago by Fakeer on Stack Overflow
1 answer

Golang - XML decoding with attr

I've got stuck with trying to unmarshall some XML from an old device I'm trying to read from. The device produces XML in ISO-8859-1 format. I've managed to transcode, but am struggling to map the ...

3 answers

Writing a Python extension in Go (golang)

I currently use Cython to link C and Python, and get speedup in slow bits of python code. However, I'd like to use go routines to implement a really slow (and very parallelizable) bit of code, but it ...

3 answers | 1 hour ago by tehwalrus on Stack Overflow
1 answer

How to do deep sets and gets in Go's map[string]interface{}?

If I have some arbitrary JSON how can I do deep sets and gets on the nested properties using a slice of map keys and/or slice indexes? For example, in the following excerpt from the JSON API example: ...

1 answers | 2 hours ago by Grokify on Stack Overflow
1 answer

Querying with an array of arbitrary keys on Google datastore in Golang

A continuation from this question: Doing a "IN Array" query on google app engine datastore with golang Right now, I am following the suggestion from the previous question on querying ...

1 answer

golang convert byte array containing unicode

type MyStruct struct { Value json.RawMessage `json:"value"` } var resp *http.Response if resp, err = http.DefaultClient.Do(req); err == nil { if resp.StatusCode == 200 { var buffer ...

1 answers | 4 hours ago by worthspending on Stack Overflow
1 answer

Go 'present' on Heroku?

So I'm new to deploying servers to Heroku, I wen't through a small tutorial on how to deploy a go app to Heroku. I've been working with the present package for presentations in html5 slides. I want to ...

1 answers | 6 hours ago by Miguel on Stack Overflow
2 answers

Golang bug or intended feature on map literals

Just started to learn Go and I need map of string string, that I initialize literally. mapa := map[string]string{ "jedan":"one", "dva":"two" } But compiler is complaining ...

2 answers | 8 hours ago by BojanT on Stack Overflow
1 answer

golang Unmarshalling websocket-rails JSON response

[ [ "client_connected", { "id": null, "channel": null, "user_id": null, "data": { "connection_id": null ...

1 answer

Google App Engine Golang no such file or directory

I am developing a Google App Engine project in go and got stuck at reading files. In fact app works perfectly locally. However when deployed, it panics telling me that there is no such file or ...

1 answer

Get variables from the environment in go?

I have data set in the environment variable GOPATH and I would like to programatically extract this data in my program. I would prefer to fetch all the ENV variables as a map[string]interface{}. This ...

1 answers | 15 hours ago by Pablo Karlsson on Stack Overflow
3 answers

Removing each element in a slice

I'm getting some unexpected behavior when I try to loop through a slice and remove every element in sequence to print the remaining elements, using the suggested Delete method from SliceTricks. For ...

3 answers | 21 hours ago by Jon Chan on Stack Overflow
2 answers

Handle different types of messages - one or many channels?

Consider this simple code: type Message struct { /* ... */ } type MyProcess struct { in chan Message } func (foo *MyProcess) Start() { for msg := range { // handle `msg` } ...

2 answers | 23 hours ago by Kos on Stack Overflow
2 answers

Casting back to more specialised interface

I'm writing a game in go. In C++ I would store all my entity classes in an array of the BaseEntity class. If an entity needed to move about in the world it would be a PhysEntity which is derived from ...

2 answers | 23 hours ago by tm1rbrt on Stack Overflow
3 answers

How to check if a map contains a key in go?

I know I can iterate over a map m by, for k, v := range m { ... } and look for a key but is there a more efficient way of testing a key's existence in a map? Thanks. I couldn't find an answer in ...

3 answers | 23 hours ago by grokus on Stack Overflow
1 answer

Finding the current working directory programmatically in go?

I have been looking trough the go documentation but so far I haven't found anything. I need help to find the current working directory programmaticly in go language. Does any one know how to do that?

1 answers | yesterday by Pablo Karlsson on Stack Overflow
1 answer

how preload a full hierachy in GO using GORM

I have a hierachy composed by several strutures type Entry struct { Id int CreatedAt time.Time UpdatedAt time.Time Fields []Field } type SyncField struct { Id ...

1 answers | yesterday by Guillaume on Stack Overflow
2 answers

Subtracting time.Duration from time in Go

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() (which wants another time.Time), but ...

2 answers | yesterday by Martijn van Maasakkers on Stack Overflow
1 answer

Slice of structs to unsorted list with mustache

I have a struct. type DataKey struct { Id int64 `db:"id"` UserId string `db:"user_id"` Data string `db:"data"` CreatedAt time.Time `db:"created_at"` } I ...

1 answer

Bodiless function in Golang

Reading the source code of math/floor.go, starting from line 13, I read some code like this: func Floor(x float64) float64 func floor(x float64) float64 { if x == 0 || IsNaN(x) || IsInf(x, 0) { ...

1 answers | yesterday by Elgs Qian Chen on Stack Overflow
1 answer

How do you add an include directory to Go/LiteIDE?

I'm attempting to use LiteIDE to run the program: // cudatest package cudatest import ( "fmt" "" ) func main() { fmt.Println("Hello, your GPU is:", ...

1 answers | yesterday by jpreed00 on Stack Overflow
0 answers

Go JSON decoding is very slow. What would be a better way to do it?

I am using Go, Revel WAF and Redis. I have to store large json data in Redis (maybe 20MB). json.Unmarshal() takes about roughly 5 seconds. What would be a better way to do it? I tried JsonLib, ...

2 answers

Nullable time.Time in golang

I have a struct that I intend to populate with a database record, one of the datetime columns is nullable: type Reminder struct { Id int CreatedAt time.Time RemindedAt *time.Time ...

2 answers | yesterday by tlehman on Stack Overflow
1 answer

Can Go code generate dll in windows or can C ++/C# call golang code?

Can Go functions be called by C++ or C# code on windows? Does Go support generating dll in Windows?

1 answers | yesterday by Pole_Zhang on Stack Overflow
0 answers

Google Datastore nested entity's in Golang

I having some problems with design my model , Because my model contains slice of a slice and im getting an error flattening nested structs leads to a slice of slices What will be the best ...

2 answers

Memory error, html/template in Go

I get some memory error when trying to execute this code: package web import ( "net/http" "html/template" ) type Hello struct { Level string } func Main(w http.ResponseWriter, r ...

2 answers | yesterday by theva on Stack Overflow
5 answers

How to determine an interface{} value's “real” type?

I have not found a good resource for using interface{} types. For example package main import "fmt" func weirdFunc(i int) interface{} { if i == 0 { return "zero" } return i } ...

1 answer

How to log queries to database drivers?

I am trying to write a simple Database application in go which access multiple data servers, some MySQL, MSSQL and SqlLite3. I am using the "database/sql" package to access them. db, err := ...

1 answers | yesterday by FlowRaja on Stack Overflow
15 30 50 per page
1 2 3