Go

Prerequisites

    Install CLI​
    Supports only project with go.sum

Command-line

Run the following command line by setting your parameters.
1
cdefense scan --lang=go --api-key=<YOUR_API_KEY> --path \
2
/work/demo/apps/vulnerable-go/ --project-name=vunerable-go
Copied!

Gitlab Integration

1
image: golang:1.14
2
​
3
cache:
4
paths:
5
- /apt-cache
6
- /go/src/github.com
7
- /go/src/golang.org
8
- /go/src/google.golang.org
9
- /go/src/gopkg.in
10
​
11
stages:
12
- test
13
​
14
run_scan:
15
stage: test
16
script:
17
- curl https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-linux-x64.tar.gz > /tmp/cd-latest-linux-x64.tar.gz && tar -C /usr/local/bin -xzf /tmp/cd-latest-linux-x64.tar.gz && chmod +x /usr/local/bin/cdefense
18
- cdefense scan --lang=go --go --project-name=go-sample --api-key=$API_KEY --path=$PWD/go.sum --verbose
19
- echo $?
20
​
Copied!
​
Last modified 1mo ago