eclipse-scala-go

eclipse-scala-go


1 answer

PortAudio: Playback lag at default frames-per-buffer

I'm trying to play audio in Go, asynchronously, using PortAudio. As far as I'm aware PortAudio handles its own threading, so I don't need to use any of Go's build-in concurrency stuff. I'm using ...

1 answer

How to separate routes, handlers, 3rd-party interfaces and business logic in real world Go project

After reading the official guide on how to structure projects and going through various (1, 2, 3 to name a few) examples and projects I can't help wondering whether my approach of structuring my ...

1 answers | 3 hours ago by klotz on Stack Overflow stackoverflow.com
0 answers

fine tuning go regular expressions

I am working with some regular expressions in go, and its not a direct process, ie takes time to work through and understand from items I've found and reading fast through the manual; any input on ...

1 answer

Prototyping struct in Go

My use case is, I need to have several structs in Go, who will have methods of same signatures and not necessarily have to have all the methods. The following code describes the requirements and also ...

1 answers | 3 hours ago by Fallen on Stack Overflow stackoverflow.com
1 answer

Golang file encryption with crypto/aes lib

I am trying to encrypt a file using the Go crypto/aes package. I have so far: func encrypt(source string, localdir string) error { src := filepath.Join("/home/bacula/cloud-backup/"+localdir, ...

1 answers | 4 hours ago by W Khan on Stack Overflow stackoverflow.com
1 answer

golang template escape first char

I'm trying to build sitemap XML file with the standard template package. But the first charset "<" become "&lt ;", and make the XML unreadable for clients. package main import ( "bytes" ...

1 answers | 4 hours ago by Alexandre Stein on Stack Overflow stackoverflow.com
2 answers

Writing a toUpper function for unicode letters

From here http://blog.golang.org/slices (it's right before the Capacity section) type path []byte func (p path) ToUpper() { for i, b := range p { if 'a' <= b && b <= 'z' { ...

2 answers | 4 hours ago by aubble on Stack Overflow stackoverflow.com
1 answer

How to convert C to Go code using eg. c2go?

I know I should probably just learn the C programming language, but I was wondering if I could somehow use the https://github.com/rsc/c2go to convert my 2000 lines c program to Go? I haven't been ...

1 answers | 4 hours ago by Dac0d3r on Stack Overflow stackoverflow.com
1 answer

golang appengine outgoing json

So I run golang appengine with go endpoints package ... I use structs to marshal and un marshal my json incoming requests and out going responses .. type BusinessWorker struct { Wid string ...

1 answer

How to implement HandlerFunc without using DefaultServeMux

If I were to use the DefaultServeMux (which I designate by passing nil as the second argument to ListenAndServe), then I have access to http.HandleFunc, which you see used below in this example from ...

1 answers | 6 hours ago by BrainLikeADullPencil on Stack Overflow stackoverflow.com
1 answer

How to find number of flags coming from console in Golang

I'm passing argument from console. There are some flags too. Like: go run test.go "-IP=10.10.10.10" "-db=kite" "-wv=45" "-cv=75" "A = value1" "B = value2" "C = 100" "D := ((A-B)/A)*C" "D ?" Here, ...

1 answers | 7 hours ago by Aerofoil Kite on Stack Overflow stackoverflow.com
1 answer

Which is the best way to process big json & replace specific values?

I have a big json (30mb) which contains "title" fields in different objects , structure of json is unknown. Known only that json contains keys "title" and string value of this key must be translated ...

1 answers | 7 hours ago by Anton.S on Stack Overflow stackoverflow.com
1 answer

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 answers | 8 hours ago by Pensu on Stack Overflow stackoverflow.com
1 answer

Can a custom HTTP handler be used globally when using Negroni or only per request?

To make sure error results are handled correctly across all requests I'm implementing a custom handler as described in http://blog.golang.org/error-handling-and-go. So instead of only accepting the w ...

1 answers | 8 hours ago by klotz on Stack Overflow stackoverflow.com
3 answers

Read whole data with Golang net.Conn.Read

So I'm building a network app in Go and I've seen that Conn.Read reads into a limited byte array, which I had created with make([]byte, 2048) and now the problem is that I don't know the exact length ...

3 answers | 9 hours ago by user2563892 on Stack Overflow stackoverflow.com
2 answers

Go 1.5: Error - imports runtime: C source files not allowed when not using cgo or SWIG

My program was building perfectly with go 1.4.2. After installing go 1.5, I am getting following error. imports runtime: C source files not allowed when not using cgo or SWIG: atomic_amd64x.c ...

2 answers | 10 hours ago by user3094829 on Stack Overflow stackoverflow.com
3 answers

Why golang Lookup*** function can't provide a server parameter?

For nslookup command, it has nslookup somewhere.com some.dns.server. However, it seems that golang dnsclient only load config from /etc/resolv.conf code here: ...

3 answers | 11 hours ago by holys on Stack Overflow stackoverflow.com
1 answer

Go, tcp too many open files debug

Here's a straightforward Go http (tcp) connection test script func main() { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, ...

1 answers | 11 hours ago by cvxv31431asdas on Stack Overflow stackoverflow.com
1 answer

GAE Full Text Search API on datastore entities using Golang

I heard that we have app engine Search API support for Golang. but it is not clear if we have can use this search API on GAE datastore entities (the Google IO 2011 video says it is possible, but not ...

0 answers

upload file with same format using beego

File Uploading is done but not with the same name as filename i have tried this in html file <html> <title>Go upload</title> <body> <form ...

2 answers

Dealing with spanish tilde in Golang

So I'm trying to enter this string into a mysql database using a sql driver. I get this error - Do?a Merced Elementary panic: Error 1366: Incorrect string value: '\x96a Mer...' for column 'name' at ...

2 answers | 13 hours ago by praks5432 on Stack Overflow stackoverflow.com
1 answer

Interface inherit from other interface in golang

Interface inheritance looks like the following in C#: interface IA{ void MethodX(); } interface IB : IA{ void MethodY(); } How can I reuse interface definition in go?

1 answers | 13 hours ago by Mohsen on Stack Overflow stackoverflow.com
1 answer

Inserting ISODate field using mgo error

I'm really new in using go, mgo and gin gonic ...I've been creating a mini app and I have a problem inserting a new register into mongoDB using mgo. My error says: "PANIC: error parsing element 0 ...

1 answers | 17 hours ago by Carlos A B on Stack Overflow stackoverflow.com
1 answer

How to write a Go function to accept different structs?

I am writing a function that parses a config JSON file and using json.Unmarshal stores its data in a struct. I've done some research and it's gotten me the point where I have a Config struct and a ...

1 answers | 17 hours ago by mbridges on Stack Overflow stackoverflow.com
5 answers

Go: why would I make() or new()?

I'm experimenting a little with Go. The introduction documents dedicate many paragraphs to explaining the difference between new() and make(), but in practice, you can create objects within local ...

5 answers | 18 hours ago by uʍop ǝpısdn on Stack Overflow stackoverflow.com
0 answers

Emoji's not rendering correctly on iphone app

We've written an app that mimics instagram for the most part for the iphone using objective C, some swift for internal API management, golang on the backend, and postgres as the datastore (all most ...

5 answers

Tool to convert (translate) C to Go?

What tool to use to convert C source code into Go source code? For example, if the C code contains: struct Node { struct Node *left, *right; void *data; }; char charAt(char *s, int ...

5 answers | 21 hours ago by Atom on Stack Overflow stackoverflow.com
1 answer

Why should I use log.Println instead of fmt.Println?

From log.go (the implementation of the log package) : 167 // Println calls l.Output to print to the logger. 168 // Arguments are handled in the manner of fmt.Println. 169 func (l *Logger) Println(v ...

1 answers | 22 hours ago by tarrsalah on Stack Overflow stackoverflow.com
1 answer

Using binary packages directly

I'm writing a library in Go. I'm planning to distribute it, and with a main requirement of 'without source codes'. For testing, I have created two workspaces like following, WS1 bin/ ...

1 answers | 22 hours ago by Swaminathan.M on Stack Overflow stackoverflow.com
1 answer

Golang Redis PubSub timeout

So far I've been doing this: import ( _redis "gopkg.in/redis.v3" "strconv" "time" ) type Redis struct { Connector *_redis.Client PubSub *_redis.PubSub } var redis *Redis ...

1 answers | 22 hours ago by GeoffreyB on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3