Questions tagged [Go] (1062)

1
answer

Why didn't parse nested JSON?

There is a JSON with attachments, then get it to parse, but the problem occurs if you enclose the JSON in these brackets []. Why is this happening? { "A": { "B": 400, "C": 137, "D": 615, "E": 352 }, "G": "dw", "F": { "ww": 0.123 } }
kane6 asked April 18th 20 at 13:34
1
answer

Why doesn't a POST request?

Trying to send a POST request to the server, but when trying to read the response (response in JSON) from the server gives an error - spoilerpanic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x640afd] goroutine 1 [running]: main.newfileUplo...
athena asked April 18th 20 at 13:17
1
answer

Golang XML Parsing how to create arbitrary attachments?

<facts> <cntr pos="63" len="5" > <town val="TOKYO" /> <cntr val="JAPAN" /> <cont val="ASIA" /> </center> <PrsnVerb pos="353" len="16" > <Name_Surname val="KUDRIN" /> <Name_FirstName val="ALEXANDER" /> </PrsnVerb> <cntr pos="2" len="6" > <town v...
letitia.Christiansen asked April 18th 20 at 12:51
2
answers

Why not assigns new keys to itnerface?

Here's a simple firmer. var save = make(map[string]interface{}) save["name"] = viper.GetString("db") save["prefix"] = db.Prefix save["tables"] = make(map[string]interface{}) save["tables"]["ddd"] = 1 Why posledni line error? invalid operation: save["tables"]["ddd"] (type interface {} does not support indexing) So it is...
lilian asked April 18th 20 at 12:47
1
answer

What is the most popular GO package that implements the authorization?

What is the most popular GO package that implements the authorization?
Tillman89 asked April 18th 20 at 12:37
1
answer

Why duplicated numbers?

Code like this package main import ( "encoding/json" "fmt" ) type Test1 map[string]interface{} var c chan Test1 func main() { val := Test1{ "s": 1, "w": 2, } c = make(chan Test1, 3) go run() for i := 0; i < 10; i++ { val["v"] = i c <- val } } func run() { for { a := <-c out, _ := json.Marshal(a)...
eleanore.Brekke84 asked April 18th 20 at 12:34
0
answer

In BeeGo as the config file to use yaml?

Good time sutrak. Examine the go and Beego framework. The documentation says that this framework uses the default ini, but there is support for xml, yaml, and json. To change the default settings, as I understand it, you need to use it.LoadAppConfig("yaml", "conf/app.conf"). I'm in the folder conf created config file.yaml....
Darren61 asked April 16th 20 at 11:16
1
answer

How to restrict the sending of queries of goroutines?

I run a pack of goroutines within which there is some requests to the API. The problem is that these queries cannot be sent more than once every 50 msec. With the help of which you can control the frequency of queries in goroutine? // main for _, url := range urls { go getUsersData(url, in) } // gorutine getUsersData fu...
Mercedes_Mill asked April 16th 20 at 11:15
3
answers

Quick sort in Golang why the right side is not sorted?

Studying the book "Grochem algorithms", now stalled for quick sorting. Code below to golang, for some reason the right side is not sorted. // example of quicksort using recursion // package main import "fmt" func quickSort(A []int, b int, k int) []int { left, right := b k-1 // define lower and upper bounds of the array ...
Quinton.La asked April 16th 20 at 11:10
1
answer

Errors downloading dependencies go in the container?

Hello. The problem arises when you expand containers multistage Assembly golang applications. For their services I describe is similar to a docker file: ######## Start first stage for building ####### FROM golang:1.14 as builder WORKDIR $GOPATH/src/github.com/myrepo/tgbot COPY ./tgbot/ . RUN go get-v-d RUN CGO_ENABLED=0...
francisco_Hayes asked April 16th 20 at 11:04