eclipse-scala-go

eclipse-scala-go


2 answers

When can safely access mutex protected variable without locking?

A common pattern of storing config in my code is a "map[string]interface{}" protected by RWMutex, but usually after app initiated (could be triggered in multiple go-routine), the map becomes totally ...

0 answers

What field corresponds to “dev” (device) param in netlink?

I'm trying to add a new route using the netlink package. The equivalent I need is ip route add $P1_NET dev $IF1 src $IP1 table $T1. The issue is that I don't know what field corresponds to the dev ...

3 answers

How to start a process?

I try to start a JVM out of a Google Go program that looks like this: package main import "fmt" import "os" import "log" func main() { var name string name="\\jrex64\\bin\\java.exe" var ...

3 answers | 5 hours ago by TheJeed on Stack Overflow stackoverflow.com
2 answers

Golang nested structs unmarshaling with underscores

I am writing an app using the Instagram API. I am receiving a JSON request and that gets Unmarshal'ed into nested structs. // the nested structs type ResponseData struct { ID string ...

2 answers | 6 hours ago by jesusjjf on Stack Overflow stackoverflow.com
0 answers

golang JWT No Signature. “crypto/rsa: verification error”

I'm using JWT. This is how I create the token. func createToken(user User) (string, error) { token := jwt.New(jwt.GetSigningMethod("RS256")) token.Claims["Name"] = user.Name ...

2 answers

How to run html on a Go server

I've created a server in Go and I'm trying to run an html file in the browser. But the browser just prints out the code like a txt file instead of rendering the html formatting. My index.html file is ...

2 answers | 9 hours ago by Kristine Rooks on Stack Overflow stackoverflow.com
0 answers

Go web server handling of Expect: 100-continue

When I make multiple "Expect: 100-continue" requests over a persistent connection to a Go net/http based server, and a request handler doesn't read one of the request bodies, the connection state ...

2 answers

Access method available to struct used in type declaration

Is it possible to access methods that are declared in a type's underlying type? For example, I want a ResourceSet to be able to call my Set type's AddId method . See: ...

2 answers | 10 hours ago by Wex on Stack Overflow stackoverflow.com
1 answer

How to get the next IP address?

I'm considering to call net.IP.String(), strings.Split(ip, "."), some code to calculate all the corner cases and finally net.ParseIP(s). Is there a better way to this?. Below is the code of my ...

1 answers | 10 hours ago by Anthony Hunt on Stack Overflow stackoverflow.com
1 answer

compiling error when using community golang buildpack on bluemix

One of my bluemix application worked for weeks but it start to report parse error with Buildpack compilation step failed when pushing app to bluemix: -----> Downloaded app package (556K) Cloning ...

1 answers | 11 hours ago by shawnzhu on Stack Overflow stackoverflow.com
0 answers

Go XML Structures

I've created structs for xml in Go: type ExceptionSorter struct { ExceptionClass string `xml:"class-name,attr"` } type ValidConnection struct { ConnClass string `xml:"class-name,attr"` } ...

2 answers

How do I do a literal *int64 in Go?

I have a struct type with a *int64 field. type SomeType struct { SomeField *int64 } At some point in my code, I want to declare a literal of this (say, when I know said value should be 0, or ...

2 answers | 14 hours ago by Conslo on Stack Overflow stackoverflow.com
1 answer

ActiveDirectory/ LDAP Authentication client package for GO Language?

I am using the below nodejs module for LDAP authentication and searching user in a particular group. I want to do similar for my GO program but i am having a hard time finding the right module. I ...

1 answers | 16 hours ago by user3846091 on Stack Overflow stackoverflow.com
1 answer

how to version packages in golang?

I've read a whole bunch of articles and SO questions on importing 3rd party go packages which all seems straight forward, but what I don't understand is that none that I have read make any references ...

1 answers | 16 hours ago by 0xor1 on Stack Overflow stackoverflow.com
1 answer

Any down-side always using pointers for struct field types?

Originally I figured I'd only use pointers for optional struct fields which could potentionally be nil in cases which it was initially built for. As my code evolved I was writing different layers ...

1 answers | 16 hours ago by Dac0d3r on Stack Overflow stackoverflow.com
2 answers

Go: reference types as arguments

Certain types in Go are reference types: maps, slices, channels, functions, and methods. Sometimes you need to use pointers to references. For example, type Stack []interface{} func (stack *Stack) ...

2 answers | 16 hours ago by oopcode on Stack Overflow stackoverflow.com
0 answers

golang error: reference to undefined identifier ‘syscall.TUNSETIFF’

So, I have been trying to build flannel (https://github.com/coreos/flannel) with gccgo. Here is the error I am getting while building: $ ./build Building flanneld... # ...

1 answer

why the “infinite” for loop is not processed?

I need to wait until x.Addr is being updated but it seems the for loop is not run. I suspect this is due the go scheduler and I'm wondering why it works this way or if there is any way I can fix ...

1 answers | 21 hours ago by Anthony Hunt on Stack Overflow stackoverflow.com
1 answer

Error when trying to xml.Unmarshal to struct with field of type map[string]interface{}

The problem is that xml.Unmarshal of a struct with a field of type map[string]interface{} will fail with the error: unknown type map[string]interface {} {XMLName:{Space: Local:myStruct} Name:test ...

1 answers | yesterday by Dac0d3r on Stack Overflow stackoverflow.com
0 answers

Correct use of XML annotations, fields and structs in custom UnmarshalXML function

Consider the following struct: type MyStruct struct { Name string Meta map[string]interface{} } Which has the following UnmarshalXML function: func (m *MyStruct) UnmarshalXML(d ...

0 answers

Intellij IDEA test configuration for golang

this is what intellij calls when I run the test: go.exe test -v "<project source folder>" -run ./... and I don't want the -run argument but the intellij adds it by default. how can I remove ...

1 answer

How to create many http servers into one app?

I want create two http servers into one golang app. Example: package main import ( "io" "net/http" ) func helloOne(w http.ResponseWriter, r *http.Request) { io.WriteString(w, ...

1 answers | yesterday by Nexus on Stack Overflow stackoverflow.com
1 answer

exec.Command does not register error from Go's own pprof tool

Here is my code: cmd := exec.Command("go", "tool", "pprof", "-dot", "-lines", "http://google.com") out, err := cmd.Output() if err != nil { panic(err) } println(string(out)) When I run the ...

1 answers | yesterday by Ben Sandler on Stack Overflow stackoverflow.com
1 answer

Getting different outputs when I change from “--” to no — on flag

Ok, I have having trouble with flags. I think I currently am on the right track but my println in my PrintRepeater program will output a true if I type "go run *.go printrepeater 3 --slow", but if I ...

2 answers

How do I convert a string to a lower case representation?

How do I convert a string to a lower case representation? I feel that there must be built-in function for it, but I just can't find it. I did find a ToLower in "unicode/letter", but it only works ...

2 answers | yesterday by oers on Stack Overflow stackoverflow.com
4 answers

How to read input from console line?

I would like to read input from the command line, but my attempts have ended with the program exiting before i'm prompted for input. I'm looking for the equivalent of Console.ReadLine() in C#. This ...

4 answers | yesterday by Dante on Stack Overflow stackoverflow.com
3 answers

Getting an “undefined: distance” error from Go compiler

I'm a seasoned "old school" programmer, but a rank beginner with Go. I'm making my way through the "CreateSpace: An Introduction to Programing in Go" book. On p. 111, the third of Chapter 9's ...

3 answers | yesterday by David Bailey on Stack Overflow stackoverflow.com
5 answers

Golang append an item to a slice

Why does a remain the same? Does append() generate a new slice? package main import ( "fmt" ) var a = make([]int, 7, 8) func Test(slice []int) { slice = append(slice, 100) ...

5 answers | yesterday by Pole_Zhang on Stack Overflow stackoverflow.com
2 answers

Passing a channel of things as a channel of interfaces in Go

My program has a pipeline structure, and I just implemented a caching filter that sends stuff directly to output if the already processed version of data is in the cache. func Run(in chan ...

1 answer

Create custom error with stack trace

I'm trying to use go-errors to include stack traces with errors I generate. I have a custom HttpError type that I also want to include stack traces. My initial thought was to do this with an embed, ...

15 30 50 per page
1 2 3