1 answer

Writing multiple structures to a File in Go

me and my group are new to Go and we have a "Header" struct and multiple "Record" structs that we're trying to write to a file. However, whenever we try to update the Header struct in the file by ...

1 answers | 24 mins ago by Mei on Stack Overflow
0 answers

BUG: time.Time does not Omit when Empty

This is a BUG I've read up on, wondering if anyone has a particular suggestion for my use-case, since I'm not sure when it's going to get fixed (last I read 1.4). I'm decoding JSON into the following ...

45 mins ago by joshula on Stack Overflow
0 answers

using go-fuse library in golang

Hello I'm about to port my two almost working simple fuse filesystems from bazillion fuse to go-fuse. go-fuse api seems more complex. The question is: In NewServer(), which RawFileSystem to ...

1 hour ago by goen on Stack Overflow
2 answers

Can't get FindId to work (GO + MGO)

Not sure what's going on here... but I'm having a heck of a time trying to get a simple operation done. I'm new to GO (trying to switch from Node) so it's probably a Type thing... User struct { ...

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

git2go fetch remote tags

Im trying to fetch the tags from a remote with git2go( When i'm cloning the repository I can list all the tags with the following code: iter, err := ...

1 answers | 3 hours ago by user1979738 on Stack Overflow
1 answer

MySQL and go-ircevent

I'm new to golang and i'm trying to impliment MySQL lookup for multiple connections, however I keep getting an error using the below code. cannot use irc.IRC("goTest", "goTee") (type *irc.Connection) ...

1 answers | 4 hours ago by BentBanana on Stack Overflow
2 answers

How can I choose between “updateSomething” and “setSomething” when naming a member method?

I have found at least three world setSth,updateSth and updateSth appear in my code when I naming a method whose function is set/update the state of this object. I'm confuse this choosing. I search ...

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

In golang what is the type of name in ec2.CreateSecurityGroup

I am using CreateSecurityGroup func in golang using goamz. Below is the function signature: func (ec2 *EC2) CreateSecurityGroup(name, description string) (resp *CreateSecurityGroupResp, err error) ...

1 answers | 5 hours ago by user3435964 on Stack Overflow
2 answers

Golang: custom template function “capture”

I want to write template function like Smarty's capture. How can I capture html inside {{capture}} ... {{/capture}} How to do this?

2 answers | 5 hours ago by cnaize on Stack Overflow
0 answers

Go with Gorilla Mux routing using Angular.js

I can't seem to get my routing right. I'm using Gorilla Mux and I'm trying to serve my angular app, so basically my index.html, from any url except them starting with "/foo". This one works: func ...

2 answers

Set of structs containing a slice

I'm trying to implement a toy search algorithm and need to maintain a set of explored states. A state is a struct: type VWState struct { botLocation VWCoords dirtLocations []VWCoords } My ...

2 answers | 9 hours ago by vlthr on Stack Overflow
1 answer

SQLite 3 not releasing memory in Golang

I'm having issues getting Go to play nicely with SQLite, I did it in the past without problems but it has been some time and I can't remember what I did to get it to work properly. I'm using Go along ...

1 answer

Go program creating OS threads for every goroutine even though there are no syscalls

I am using go 1.3.3. I am running the following go program on my mac which is 10.9.2 Intel Core i7: package main import ( "fmt" "sync" ) func justprint(i int, wg *sync.WaitGroup) { ...

1 answers | 12 hours ago by Bharat on Stack Overflow
1 answer

Control the mouse and keyboard Golang?

How would one go about controlling retrieving/setting the position of the mouse and triggier keyboard events on the operating system/X11 level? This is similar to functionality found in the Robot ...

1 answers | 12 hours ago by Hakar on Stack Overflow
2 answers

Go compiler tricks

I read in a talk that the Go compiler will aggressively remove code that isn't used in the output binary. The talk which I can't find used this for adding some code useful to testing. Does anybody ...

2 answers | 17 hours ago by Drew on Stack Overflow
1 answer

A function by type? How refactor it?

I'm reading json data from a file and sending it to a remote server using gob encoding, but I'm not happy with my code, I tried several ways to get a more generic function, but I'm failed, the only ...

1 answers | 19 hours ago by Jzala on Stack Overflow
4 answers

Go: disallow direct struct initalization

Given the following packages in Go, is it possible to prevent the direct initialization of Bar with Bar{..} without de-exposing Bar from the package? package bar: package bar import () type Bar ...

4 answers | 20 hours ago by RickyA on Stack Overflow
1 answer

double quotes escaping in golang exec

i need to run following command: ffmpeg -i input.jpg -vf scale="'if(gt(a,4/3),320,-1)':'if(gt(a,4/3),-1,240)'" output_320x240_boxed.png so i execute: cmd = exec.Command("ffmpeg", "-i", ...

1 answers | 20 hours ago by Pavel K. on Stack Overflow
2 answers

GAE Golang - urlfetch timeout?

I am having issues with urlfetch's timeouts on Google App Engine in Go. The app does not appear to want to take a longer timeout than about 5 seconds (it ignores a longer timeout and times out after ...

1 answer

how do I clear the close-on-exec flag in go?

When os.OpenFile is called on Centos6, the O_CLOEXEC flag is set on the file handle. I don't think it is possible to avoid the flag being set. For example, the following call: f, err := ...

1 answers | yesterday by Martin on Stack Overflow
1 answer

How to manipulate decoded XML with Struct passed in as interface parameter

Is there a way to manipulate decoded XML with struct passed in as interface parameter? I'm passing struct as a parameter which has interface type but after decoding it with xml.Decode I cannot ...

1 answers | yesterday by Passionate Developer on Stack Overflow
2 answers

How do I get CMake to work with the go programming language?

I have been using CMake with C++ to build libraries and executables and would like to use the same for the go programming language. What steps do I need to take to configure CMake so it would work ...

2 answers | yesterday by kfmfe04 on Stack Overflow
3 answers

How to test key existence in a map?

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 | yesterday by grokus on Stack Overflow
8 answers

Can Go really be that much faster than python?

I think I may have implemented this incorrectly because the results do not make sense. I have a go program that counts to 1000000000 package main import ( "fmt" ) func ...

8 answers | yesterday by troq on Stack Overflow
1 answer

Go: Load certificate so it becomes a *x509.Certificate (that is able to sign other certificates)

I've asked in golang-nuts but no response!topic/golang-nuts/EhlpMiMAPSM I don't think duplicating the mail bodies would make much sense, since I don't believe ...

1 answers | yesterday by dalu on Stack Overflow
1 answer

Sequential queries with golang & mongodb

Wondering what is best way to make sequential queries from Golang for a mongodb. Example lets say you have : result *bson.M ids:=["543d171c5b2c12420dd016","543d171c5b2dd016"] oids := ...

1 answers | yesterday by Daemon1313 on Stack Overflow
1 answer

Different treatment of ObjectID by mgo driver on Windows and Linux

I develop Go code to work with MongoDB using mgo driver. First I developed it on Windows computer, and it worked just fine (with Mongo DB installation on the same Windows computer). Then I copied the ...

1 answers | yesterday by user3526096 on Stack Overflow
1 answer

How do I dynamically iterate through a package?

This is my first week with Go, so please forgive the ignorance ;). I come in peace from Python. I am building a simple calculator with Addition and Subtraction currently. My addition.go file looks ...

1 answers | yesterday by llamawithabowlcut on Stack Overflow
1 answer

Order by nested object in RethinkDB using Go driver

How is it possible using Go driver fetch data from RethinkDB in order by of nested object? So let's imagine I have such json in my table: [ { "id": "1", "date": "2001-01-15", ...

1 answer

Go get doesn't work, I have git

Following go getting started page, want to install revel, it says it can't find hg, I have git and I am comfortable with it. Double checked %PATH%, it has Git/cmd and Git/bin

15 30 50 per page
1 2 3