From a5911ad7bb12482fc6b6470671bb924ce0e38b43 Mon Sep 17 00:00:00 2001 From: Cosmin Cojocar Date: Mon, 4 Jan 2021 10:19:01 +0200 Subject: [PATCH] Fix compilation errors in the test samples Signed-off-by: Cosmin Cojocar --- testutils/source.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/testutils/source.go b/testutils/source.go index 9a6abc6..cec6d05 100644 --- a/testutils/source.go +++ b/testutils/source.go @@ -582,7 +582,6 @@ import ( "fmt" "log" "net/http" - "net/http/pprof" ) func main() { @@ -1632,8 +1631,11 @@ import ( func main() { repoFile := "path_of_file" - relFile := filepath.Rel(repoFile) - _, err := os.OpenFile(relFile, os.O_RDONLY, 0600) + relFile, err := filepath.Rel("./", repoFile) + if err != nil { + panic(err) + } + _, err = os.OpenFile(relFile, os.O_RDONLY, 0600) if err != nil { panic(err) } @@ -2229,10 +2231,11 @@ func printVector() { fmt.Println() } -func foo() (int, *string, string) { +func foo() (int, **string, *string) { for _, item := range vector { return 0, &item, item } + return 0, nil, nil } func main() {