Questions tagged [go]

Go is an open source programming language initially developed at Google. It is statically-typed, with a syntax loosely derived from C, adding automatic memory management, type safety, some dynamic typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.

0
votes
1answer
8 views

How Find function's generic map was created?

I am looking at this example. I would never coome up with solution like this,I would go for bson.raw. type Movie struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` Name ...
0
votes
0answers
6 views

golang mongodb group aggregation returning dummy records

I am trying fetch documents from mongdb using golang code base. I created a pipeline and am using aggregate function like this: pipeline := []bson.M{ bson.M{ "$group": bson.M{"_id"...
1
vote
0answers
16 views

Why can't I deploy to GAE using the gcloud command in go?

I'm trying to deploy an application written in go to GAE. When I call gcloud app deploy it says this: Updating service [default]...failed. ...
0
votes
0answers
17 views

Gitea Source build on windows asset compilation

I'm trying to custom build gitea from source on Windows. So I am new to go, but I won't let that stop me :) So obviously I first want to build Gitea stock standard from source before customizing it. ...
-1
votes
1answer
22 views

How to fix “missing type in composite literal” in test cases

I am trying to write test code for the function ReadField() but I am having difficulty defining the test cases. It gives an error "missing type in composite literal". I believe its just some syntax ...
0
votes
0answers
12 views

gopacket ubuntu16.04 error undefined: pcapErrorNotActivated

root@ubuntu:~/processNet/processNet# go run testversion.go github.com/google/gopacket/pcap /home/go/src/github.com/google/gopacket/pcap/pcap.go:30:22: undefined: pcapErrorNotActivated /home/go/src/...
0
votes
1answer
17 views

Map reducing does not work wether I close channel or not

This is homework and beginner question. I edited the question since I made a mistake that I found. I am trying to do parallel frequency maps from a text and I get an error in the last operation (...
1
vote
1answer
23 views

Authenticate users on certain handle requests

Is there a more efficient way to authenticate users on certain handle requests? Right now I am calling a function to authenticate based off of the request token but am doing that for every handle ...
0
votes
0answers
19 views

Transforming golden and input files in test table

I'm trying to find a way to create a test table from golden and input files. I have the following dir structure: pkg | | mypackage/ | testdata/ | file1.input | file1.golden | file2....
0
votes
1answer
31 views

How to fix the results are not fully displayed

I have go a sample recursive code in go playground, there are 2 "?", the target is to generate all binary strings replacing ? with 0 or 1 , it supposes to display 4 results, but only display 3. ie ...
-1
votes
1answer
17 views

GO zip.NewWriter() creating empty zip archives

I have the following function I'v tried to simplify to just adding a single file to a .zip archive. Whatever I try, the resulting .zip file has no files listed in it. The size of the archive is ...
-3
votes
0answers
23 views

RedHat 5 - Kill -9 doesn't return a frozen process to a shell prompt

I have a RH5 machine and I am running a multithreaded GoLang program on it. Most of the threads are processing jobs in a job queue, and one thread is printing overall job processing progress to the ...
0
votes
0answers
16 views

Convert a thrift file to a json file

Problem: The data solution I use in my project is only support json and yaml file. But I also need to store IDL thrift file. Do you have better solution for this problem? One Approach: Read thrift ...
0
votes
0answers
11 views

zserge/lorca ui.Eval panic

Using github.com/zserge/lorca to pass HTML variables to a go func. When using lorca's Eval method to extract my variables, it panics with invalid memory err. Not sure if this is a bug, or has to do ...
0
votes
0answers
29 views

GOLANG - Formatting float to currency string (with point in the thousands and comma in the decimal separator)

I have a code that formats a string to a big float: formattedAmount := strconv.FormatFloat(amount, 'f', 2, 64) The result of this is a float with precission of 2 after the comma, IE: ...

15 30 50 per page