1 answer

How To Authenticate Across Subdomains

I'm working on a web application which actually consists of two applications under the hood. One application is called account and handles all things related to user accounts such authentication, ...

2 answers

issue with accessing GET parameters net/http in golang

Following is my go program to extract GET parameters. (URL: /mysql? package main import ( "net/http" "fmt" //"encoding/json" //"html" ...

0 answers

Testing Stdout with go and ginkgo

here I am making my first steps in go trying to do BDD on a go command line app. I am using Ginkgo, which wraps testing.go and lets you do more expressive BDD. I am ...

3 answers

Why can't I use the blank identifier in the following Go code?

for _, arg := range flag.Args() { go func() { path.Walk(arg, dupes, walkerrs) walkend <- true }() } for _ := range flag.Args() { if !<-walkend { os.Exit(1) …

3 answers | 7 hours ago by Matt Joiner on Stack Overflow
2 answers

Print type of a structure without creating its instance

In Go, I can print a type of a structure by fmt.Printf("%T",Struct{}) however this creates a new structure and hence taking up a memory. So I may just print fmt.Printf("main.Struct"), but then suppose …

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

How do you set the application icon in golang?

I've just created my first go application on Windows. How do I give it an icon? There doesn't seem to be any build flags to do this, and I know golang doesn't support resources.

1 answers | 8 hours ago by Gordon Truslove on Stack Overflow
1 answer

Golang - Timestamp losing year after formatting and storage

I am using the Go runtime to store entities in the Appengine Datastore sequenced by the time they were added; to store the timestamp in the key I am formatting the timestamp using the ...

1 answer

golang - codecoverage always shows coverage: 0.0% of statements

I created one sample go project and created a unit test cases for the same (In Linux environment, go1.3 version) When i ran go test the output would be PASS ok supported_db 0.201s …

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

Why does inline instantiation of variable requires explicitly taking the address of it to call pointer method, while for a existing var its implict

Is there a reason for this behaviour? I would like to know what is different in the memory level. The compiler returns "cannot take the address of composite literal" while i can explicitly ask it to …

2 answers | 10 hours ago by Gnani on Stack Overflow
1 answer

Setup golang environment using jetbrains

I have setup an golang developing envionemnt using idea (13.1 community edition). It seems the SDK is recognized. However, I could not create a GO file by right click the "New" under the source ...

1 answers | 11 hours ago by python on Stack Overflow
1 answer

Exec.Command Interrupt

I'm writing an application that will run as a daemon on ubuntu 14.04. The purpose of this daemon is to run a for loop that will check for data in various database tables and if data is present it will …

1 answers | 13 hours ago by wey23 on Stack Overflow
3 answers

Abstract data type constructor can be accidentally bypassed?

I'm trying to make an abstract data type representing a positive number: package m type positiveNum int func MakePositiveNum(i int) positiveNum { if i < 1 { panic("non positive number") } …

3 answers | 15 hours ago by Dog on Stack Overflow
2 answers

How to install Hugo?

I have downloaded and unzipped the hugo_0.11_linux_amd64.tar.gz file from the releases page, and I cannot figure out how to run the binary. I took a few stabs at using go run, and sh, but no luck. Can …

2 answers | 16 hours ago by cjohnson318 on Stack Overflow
2 answers

Use Hugo to render html files

I am using Hugo to render a folder with html/css/js files as localhost in my laptop. I have html files in /content and all js/css/img files in /static ...

2 answers | 16 hours ago by HP. on Stack Overflow
2 answers

Serve static content in Go Web Language

I want to serve html, css and js file in GO web Programming after getting Get request. Restriction: Don't have to use any framework. As there is very few Blog or study material available. Can any …

2 answers | 20 hours ago by dpsingh on Stack Overflow
1 answer

App Engine for Go app update not reflecting

Using Google App Engine for Go. I have successfully deployed my project update, but it is not reflected back on the Web URL. Does anyone have any idea about that? I have tried Updating it twice. …

1 answers | yesterday by dpsingh on Stack Overflow
1 answer

(un)marshalling json golang not working

I'm playing with go and am stumped as to why json encode and decode don't work for me I think i copied the examples almost verbatim, but the output says both marshal and unmarshal return no data. ...

1 answers | yesterday by Toad on Stack Overflow
1 answer

Golang: Can I cast to chan interface{}

I am trying to write a general purpose wrapper for subscriptions, something like: type Subscriber interface{ Subscribe(addr string) chan interface{} } Suppose there is a library I want to use …

1 answer

why Revel web framework tutorial app doesnt work

I'm a beginner in Go and I want to use the revel web framework to develop web applications. I followed the tutorial to install and test revel from: But …

1 answers | yesterday by jefree on Stack Overflow
2 answers

Why is there no type mismatch error?

I define the number to be input by user as var input float64 and I input an integer and I would expect to get an error but I get err = <nil>. What am I missing? package main import ( "fmt" …

2 answers | yesterday by Zeynel on Stack Overflow
5 answers

Go-Sublime-build configuration

Im having issues trying to set up go to run the current file from Sublime text 2. Here's what I have in my go.sublime-build file { "cmd": [ "go", "run", "${file}" ] } When I try to run build …

5 answers | yesterday by gprasant on Stack Overflow
2 answers

Error in importing custom packages in Go Lang

I have created a library by the name libfastget which is in the src with my program as src |-libfastget | |-libfastget.go | |-MainProgram |-main.go and the libfastget exports a function ...

2 answers | yesterday by Shenal Silva on Stack Overflow
2 answers

How to map m:n relation to slice field?

I have a struct Person: type Person struct { Id int64 Name string Colors []string } which should get its data from a person table: id | name --------- 1 | Joe 2 | Moe and a …

2 answers

One function switching on type vs Many typed functions

Given the following struct Foo and goal of handling multiple types (where Handle could be Read, Write, etc.). I understand that we lose compile-time type checks when we use the empty interface, though …

2 answers | 2 days ago by jpillora on Stack Overflow
2 answers

How to write a simple custom http server in Go?

I am new to Go and trying to write a custom http server.Getting compilation error. How can I implement the ServeHTTP method in my code? My Code: package main import ( "net/http" ...

2 answers | 2 days ago by AnkurS on Stack Overflow
2 answers

Converting json to slice of maps and slice of maps to json in Go without using structs

I am trying to convert a json string from an http request to a slice of map/s. And I should also convert a slice of map/s to json string to use for a http response. I want to convert the followings …

2 answers | 2 days ago by fsc on Stack Overflow
1 answer

Testing HTTP routes in Golang

I am using Gorilla mux and the net/http package to create some routes as follows package routes //some imports //some stuff func AddQuestionRoutes(r *mux.Router) { s := ...

1 answer

GAE Go - how to handle ErrConcurrentTransaction Datastore Transaction error

I am writing a Google App Engine Golang app. In the Datastore Transaction documentation, there is a note: Note: If your app receives an error when submitting a transaction, it does not always mean …

3 answers

Constant 1 truncated to integer?

Why wont this code compile? package main const a = 1.000001 const base = 0 const b = a+base func main() { f(b) } func f(int) {} $ go run a.go # command-line-arguments ./a.go:4: constant 1 ...

3 answers | 2 days ago by Dog on Stack Overflow
1 answer

Go: delete post with sql

How do I assign each button that appears beside a tweet in the array, the id of the tweet? I have each button printed beside each tweet, so when I click the button, the sql query should delete the ...

1 answers | 2 days ago by user3918985 on Stack Overflow
15 30 50 per page
1 2 3