python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Why is WaitGroup.Wait() hanging when using it with go test?
Here's a simple example of what I mean
package main
import (
"sync"
"testing"
"time"
)
func TestWaitGroup(t *testing.T) {
var wg sync.WaitGroup
quit...
Paul Côté
Votes: 0
Answers: 2
How to handle json syntax error in a go test case?
I'm testing a scenario where json.Unmarshall fails and returns
&json.SyntaxError{msg:"unexpected end of JSON input", Offset:0}
the code is like this:
err = json.Unmarshal(input, &da...
jimmy
Votes: 0
Answers: 1
Run go test using Golang's exec library
I am trying to run go test command using the exec library as this.
output, err := exec.Command("bash", "-c", "go test -v -run TestX ./test/*").Output()
if err != nil ...
techjourneyman
Votes: 0
Answers: 0
Go gin nested JSON request body POST, error unexpected end of JSON input
I am new to GO and was trying to create a simple POST API with gin and gorm.
The request data is nested JSON like below:
{
"fall_orders_request": [
{
"fruit": "Wat...
Valhala
Votes: 0
Answers: 1