mirror of
https://github.com/securego/gosec.git
synced 2025-03-01 04:33:29 +00:00
Fix compilation errors in the test samples
Signed-off-by: Cosmin Cojocar <ccojocar@cloudbees.com>
This commit is contained in:
parent
23ef7009f9
commit
a5911ad7bb
1 changed files with 7 additions and 4 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue