0 answers

How to add a sheet in an excel sheet using go lang

I have used the xlsx package and it works well for reading a xlsx file.It also works well for creating a new xlsx file.But for writing into the xlsx file it shows error while opening the xlsx file.

1 answer

Testing request with cookie

I wrote a cookie getter and setter. Now I want to test it, and wrote following test function. func TestAuthorizationReader(t *testing.T) { tw := httptest.NewServer(testWriter()) tr := ...

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

urllib.quote() in Golang?

Is there any function in Golang works the same as urllib.quote(string) in Python? Thank you! The document page for urllib.quote():

2 answers | 10 hours ago by lkkeepmoving on Stack Overflow
0 answers

Possible to change Golang template during runtime without server restart?

As the title says I need to be able to change Golang templates during runtime, since I'm building a CMS in Go. People should be able to change template markup without restarting the server everytime. ...

1 answer

Defer called in go routine

I believe I understand defer well in the normal use cases. Such as the one listed in this question Go(lang) Defer behavior. However I am a little perplexed as to what is happening when defer is called ...

1 answers | 14 hours ago by mschuett on Stack Overflow
1 answer

GAE datastore, GetMulti() with Projection?

My application puts together a grouping of many different Kinds of data for a report to the user, this report takes a while to compile and it is useful for the user to see this snapshot at a later ...

1 answers | 15 hours ago by Blair Connolly on Stack Overflow
1 answer

Docker on Mac behind proxy that changes ssl certificate

I am running into a problem with my initial attempt to get Docker running on my Mac at work, which is running 10.8.5. It appears that my company's certificate-rewriting proxy seems to be getting in ...

1 answers | 16 hours ago by pohl on Stack Overflow
2 answers

Go(lang): Implementing a cron / executing tasks at a specific time

I have been looking around for examples on how to implement a function that allows you to execute tasks at a certain time in Go, but I couldn't find anything. I implemented one myself and I am ...

0 answers

go https client leaks

I wrote simple https client program for tests. It should work in keep-alive mode and not keep-alive. And it leaks badly.. In keep-alive mode it leaks twice slower. This is sample working program. ...

2 answers

Unmarshal XML Array in Golang: Only Getting The First Element

Code: type HostSystemIdentificationInfo []struct { IdentiferValue string `xml:"identifierValue"` IdentiferType struct { Label string `xml:"label"` Summary string ...

2 answers | 19 hours ago by Kyle Brandt on Stack Overflow
2 answers

golang - how to initialize a map field within a struct?

I'm confused about the best way to initialize a struct that contains a map. Running this code produces panic: runtime error: assignment to entry in nil map: package main type Vertex struct { ...

2 answers | 19 hours ago by Matt Ball on Stack Overflow
2 answers

Golang Flag gets interpreted as first os.Args argument

I would like to run my program like this: go run launch.go --m=2 --strat=par "" gets interpreted as the first command line argument, which is ok, but the flags ...

2 answers | 19 hours ago by Ive on Stack Overflow
1 answer

Unmarshalling XML with (xpath)conditions

I'm trying to unmarshall some XML which is structured like the following example: <player> <stat type="first_name">Somebody</stat> <stat ...

1 answers | 20 hours ago by paukul on Stack Overflow
1 answer

More easy way of using Interfaces to map YAML dynamically?

I am trying to parse a yaml file dynamically (Therefore no struct). package main import ( "fmt" "" "log" ) func main() { var out = ` a: First! f: Second b: c: ...

1 answers | 21 hours ago by Kasinath Kottukkal on Stack Overflow
2 answers

golang reference struct in same package in another file

main.go lib/file_1.go ... package lib ... type MyStruct struct{ } .... How to reference "MyStruct" in another file in the same package/folder? I get undefined: MyStruct when go build ...

2 answers | 22 hours ago by Chris G. on Stack Overflow
3 answers

How can I pass an array as a list of args to a function with varying number of parameters in C

I wonder how can I tease out an array in C to several arguments of a function. After I saw the amazing syntatic sugar from Go (golang) I thinking about it. The c code: #include <stdio.h> ...

3 answers | 22 hours ago by Danilo on Stack Overflow
1 answer

How to log per request / context - Golang

I'm trying to migrate an a web app from Google Appengine to a dedicated server and I've got stuck to the logging issue. Basically I would like to organise the logs per request/context(like on GAE) so ...

0 answers

Is there a way to detect memory leaks for Go programs using cgo on Windows

I'm using cgo to link to C libraries or to use C code in my Go projects and I was wondering if there's a way to detect memory leaks on Windows.

2 answers

Does it make sense to install the runtime on docker?

I'm considering deploying some apps on docker (aws beanstalk being the provider). Going though various resources I've found it's recommended to use a base images, in my case the official golang image ...

2 answers

Marshalling XML Go XMLName + xmlns

I am trying to achive the following XML output <?xml version="1.0" encoding="UTF-8"?> <CreateHostedZoneRequest xmlns=""> <Name>DNS ...

1 answer

How to get value from map - GOLang?

I am working in GOLANG Problem Fetching data from map Data Format res = map[Event_dtmReleaseDate:2009-09-15 00:00:00 +0000 +00:00 Trans_strGuestList:<nil> strID:TSTB] Note How to get the ...

1 answers | yesterday by karthick.k on Stack Overflow
2 answers

How to rebuild all library after upgrading Go 1.4

I was using Go 1.3.3. After installing 1.4, there are many errors similar to this: db/base.go:4: import /home/asd/Dropbox/go/pkg/linux_amd64/projc1/libs/Bool.a: object is [linux amd64 go1.3.3 ...

2 answers | yesterday by Kokizzu on Stack Overflow
1 answer

Does it make sense to test time-based fields ? (golang)

I have several structs with fields of type time.Time. I'm wondering what's the best practice to test them? Should I simply set the time.Time fields to nil and test the rest of the struct (i.e. ...

2 answers

Golang - How to extract part of an XML file as a string?

My XML looks something like this: <a> <b> <c> <d>TEXT</d> </c> </b> </a> I know how to separate this code via the xml.Unmarshal ...

2 answers | yesterday by IanZG on Stack Overflow
3 answers

how to analyse golang memory

I wrote a golang program, It cost 1.2GB at the runtime. when I use go tool pprof to got a dump。 It show only 323.4MB in the heap. what is other memory ...

1 answer

Misunderstanding the usage of := in Go

I was reading this doc and saw the following fragment: The := syntax is shorthand for declaring and initializing a variable, e.g. for var f string = "short" in this case. f := "short" ...

1 answers | yesterday by Guilherme Oderdenge on Stack Overflow
1 answer

Creating API backend on App Engine

I would like to create a rest backend for an application on App Engine using Go. I have arranged my files as fallow: -> app/ -> auth/ -> auth.go -> app.go -> app.yaml ...

1 answers | yesterday by alex on Stack Overflow
2 answers

Nested data structures in go - python equivalent

I can create this data structure in Python really easily: data = {'Locations': [], 'Dates': [], 'Properties': [{'key': 'data1', 'value': 'data2'}], 'Category': 'all'} Which can then be ...

2 answers | yesterday by user1513388 on Stack Overflow
0 answers

Logsend fails to send logs to Influx db

I am trying to collect centrally all logs of my system. I prefered to go with logsend and influx db. I am using a mac book pro and I installed influx db using brew. I installed logsend locally also ...

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
15 30 50 per page
1 2 3