go-testing Questions

2

Solved

I'm pretty new with Go, and I'm coming from OOP languages. Now the concept seems quite different in go of interfaces and classes. I was wondering how mocking would work in case of testing. The conf...
Isopropanol asked 25/3, 2021 at 16:33

1

Solved

Problem I am building a REST API in Go. The godotenv package is used to load the environment variables. Running go run main.go, the project runs the API as expected, the environment variables are l...
Unimpeachable asked 12/7, 2021 at 11:15

0

I met a strange issue when doing test with channels. In a normal main function, the following code will report the deadlock error. package main import ( "fmt" ) func main() { c := make(chan i...
Lowminded asked 15/5, 2020 at 14:30

2

Solved

I have a Go project with the following structure: foo/foo.go foo/foo_test.go main.go As you notice, there is no test for main.go. I collect the coverage report using the following command: go ...
Raquel asked 24/1, 2020 at 20:18
1

© 2022 - 2024 — McMap. All rights reserved.