2 answers

Serving a websocket in Go

I'm starting to play around with websockets + go and well I think I'm misunderstanding something quite basic with websockets in Go. I'd like to simply listen for a websocket connection and process …

2 answers | 1 hour ago by Gybe on Stack Overflow
1 answer

Go Tour Slices Exercise logic

I am trying to complete the Exercise: Slices from the Go Tour however I don't really understand what I'm being asked to do. Implement Pic. It should return a slice of length dy, each element of …

1 answers | 2 hours ago by Bula on Stack Overflow
2 answers

What's the Go equivalent of a C++ static const function variable?

In C++ you can write things like this: std::string foo() { const static std::vector<std::string> unchanging_data_foo_uses = {"one", "two", "three"}; ... } I've always thought one ...

2 answers | 4 hours ago by Mozza314 on Stack Overflow
1 answer

when attempting to render results page on form submission, blank html document is shown

The code below renders the initial page, which has a form in it. On submission of that form, I want to render a results page. The form submits and is handled, but all I see is a blank html document. …

1 answers | 7 hours ago by user3743069 on Stack Overflow
1 answer

How to log http server errors in golang?

I'm trying to catch and log http error 400 that happens when url params are not encoded properly. My server implementation looks like: router := http.NewServeMux() router.HandleFunc("/", ...

1 answers | 10 hours ago by serg on Stack Overflow
2 answers

Google Go: notwithstanding keyword

What does the notwithstanding keyword mean in Google Go? For background, see, which was linked from Reddit | Programming.

2 answers | 11 hours ago by Justin Ethier on Stack Overflow
3 answers

Defining golang struct function using pointer or not

Can someone explain to me why appending to an array works when you do this: func (s *Sample) Append(name string) { d := &Stuff{ name: name, } = append(, d) } …

3 answers | 11 hours ago by Jacob on Stack Overflow
2 answers

too many arguments to return ( golang )

In a print function I am writing, I am trying to return a value based on the result of a switch statement; however, I am getting the error too many arguments to return. Forgive me if this question …

2 answers | 13 hours ago by user3743069 on Stack Overflow
0 answers

Interfaces and encoding/xml Unmarshal

I have a soap service I'm writing against. One portion of the soap API is for returning a query result, and I'm hoping to provide the base structs for decoding the envelope, while allow a developer to …

15 hours ago by kwolfe on Stack Overflow
1 answer

Youtube API Invalid Grant and Required parameter is missing: grant_type

I'm having trouble authenticating with the Youtube API via OAuth. It gives me this error: "error" : "invalid_grant" for CURL "error" : "invalid_request", "error_description" : "Required parameter …

1 answers | 16 hours ago by Rilee on Stack Overflow
1 answer

How can I read consul SRV records in my go application?

I am trying to implement consul for service discovery, and I am having trouble with two things: connecting to a custom DNS server, and formatting my net.LookupSRV() request. Here is what I'm trying …

1 answers | 16 hours ago by ben schwartz on Stack Overflow
1 answer

dereference pointer to DB in struct

Usually when I see a field declared on a struct it's without a pointer or a dereferenced pointer symbol *, however in several code snippets where I've seen a database field in a struct it's with a ...

1 answers | 17 hours ago by Leahcim on Stack Overflow
1 answer

Unable to get db response for update query for further execution in go

I want to update data in remote db table and do further tasks but could not do it. Using same code with insert query, I am able to insert values in same table where I am getting response very fast …

1 answers | 18 hours ago by SwapnilD on Stack Overflow
0 answers

heroku app - crashed on sign in

I'm trying to get my app running on Heroku. I built my program in Go. I'm using clearDB for my SQL database. Heroku displays the first page of my web app, which is a login page. However, when I ...

0 answers

OAuth2 Authorization Code in Cookie, good or bad?

I can not seem to find a SIMPLE answer to the question on how to persist OAuth2 authentication... Let's take Google+ OAuth2 API as an example. User goes to page User is not authenticated, and gets …

1 answer

Go polymorphism in function parameters

i found several questions with similar titles, but cannot find the answer to my question in them: I have the following simple scenario: types: type intMappedSortable interface { ...

1 answers | 21 hours ago by billdoor on Stack Overflow
4 answers

Can Native Client (NaCl) programs be written in languages other than C or C++?

Would it be possible to write a native client application in Python or Go that could then run in the browser?

4 answers

How to find a type of a object in golang?

How Do I find type of an object in Golang ? In python i just use typeof to fetch the type of object. Similarly in go, is there a way to implement the same ? Here is the container from which I am ...

4 answers | yesterday by Rahul on Stack Overflow
2 answers

Referencing a method from one file to another in GO language

I am learning Go language out of my own interest . I come from a typical OO programming . I am bit kind of stuck in using a method present in one file from another. So , D:\lib\pac\abc.go has a method …

2 answers | yesterday by user1907849 on Stack Overflow
1 answer

Is it possible to use less `struct`s in this golang code?

Given the following XML which is out of my control: <Stuff> <SomeData> <SomeDataStuff> <AccountDetails> <Person xsi:nil="true" /> ...

1 answers | yesterday by Jacob on Stack Overflow
1 answer

GAE Golang - HTTP JSON RPC call works in the dev_appserver, but not on the App Engine?

I'm creating a Go Google App Engine application that will be making HTTP JSON RPC calls to a Bitcoin server. I got my code to work properly on the dev_appserver, but when deployed on GAE, the code ...

2 answers

how to generate a random token with md5

I'm trying to generate a random token that I can use while implementing reset password functionality. This ( is the dazzling and non-functional :( code that I came …

2 answers | yesterday by Leahcim on Stack Overflow
2 answers

Order of execution inside go routines

I recently started with go and I am really confused about the order of execution of this program. I hope I am not asking really trivial questions here. This is basically #69 in the golang tour, with …

2 answers | yesterday by meto on Stack Overflow
3 answers

Customizing the tests in Go

I have a scenario running testcases in GO where in I know that a testfile for eg: first_test.go will pass after second or third attempt , assuming that it is invoking a connection to a database or …

3 answers | yesterday by user1400915 on Stack Overflow
3 answers

A channel multiplexer

Note - newbie in go. I've written a multiplexer that should merge the outputs of an array of channels into one. Happy with constructive criticism. func Mux(channels []chan big.Int) chan big.Int { …

3 answers | yesterday by OldCurmudgeon on Stack Overflow
1 answer

Go: “all.bash” compilation testing fails with “permission denied”

I'm trying to install Golang in a Bluehost shared server. I've done the following on the server so far: cd ~ wget tar -xvf ...

1 answer

Golang exported type

Suppose I have a package within a package foo/ main.go (package main) bar/ bar.go (package bar) Now, within bar.go I would like to use an exported type from main.go. …

1 answers | yesterday by Jan Netherdrake on Stack Overflow
1 answer

Go 1.1.1 and ODBC with MSSQL

Currently have FreeTDS 0.92.4 / unixODBC 2.3.1 up and running, connecting with a MSSQL server and able to execute queries etc. I've found this list of ODBC implementations for Go, and have tried the …

1 answers | yesterday by Justin on Stack Overflow
2 answers

bulk upserts within a sql transaction in golang

I've been messing around with golang's sql package with transactions, and I'm trying to understand how to do bulk upserts without the "per insert" round trip communication for each row. The examples …

1 answer

Converting Method to generic way, finding with mgo

I'm trying to get getObj() function will be more general and could work with any type, not only User like in my code. I was thinking in return a interface instead a defined struct, but I can't fit ...

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