Fix compilation errors in the test samples

Signed-off-by: Cosmin Cojocar <ccojocar@cloudbees.com>
This commit is contained in:
Cosmin Cojocar 2021-01-04 10:19:01 +02:00
parent 23ef7009f9
commit a5911ad7bb

View file

@ -582,7 +582,6 @@ import (
"fmt" "fmt"
"log" "log"
"net/http" "net/http"
"net/http/pprof"
) )
func main() { func main() {
@ -1632,8 +1631,11 @@ import (
func main() { func main() {
repoFile := "path_of_file" repoFile := "path_of_file"
relFile := filepath.Rel(repoFile) relFile, err := filepath.Rel("./", repoFile)
_, err := os.OpenFile(relFile, os.O_RDONLY, 0600) if err != nil {
panic(err)
}
_, err = os.OpenFile(relFile, os.O_RDONLY, 0600)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -2229,10 +2231,11 @@ func printVector() {
fmt.Println() fmt.Println()
} }
func foo() (int, *string, string) { func foo() (int, **string, *string) {
for _, item := range vector { for _, item := range vector {
return 0, &item, item return 0, &item, item
} }
return 0, nil, nil
} }
func main() { func main() {