Skip to content

Commit

Permalink
Add github action to run lint on PRs (#6)
Browse files Browse the repository at this point in the history
* add github action to run lint on PRs
  • Loading branch information
pablo-ruth authored Oct 8, 2019
1 parent 75ab68e commit 420a8ce
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR
on: [pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Setup Lint
run: curl -LO https://github.com/golangci/golangci-lint/releases/download/v1.19.1/golangci-lint-1.19.1-linux-amd64.tar.gz && tar -xf golangci-lint-1.19.1-linux-amd64.tar.gz

- name: Lint
run: golangci-lint-1.19.1-linux-amd64/golangci-lint run
16 changes: 12 additions & 4 deletions system_certificate_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@ func createCertificateForm(name, password string, cert, key []byte) (form *bytes
w := multipart.NewWriter(&b)
defer w.Close()

w.WriteField("mkey", name)
w.WriteField("vdom", "global")
w.WriteField("type", "CertKey")
w.WriteField("passwd", password)
fields := map[string]string{
"mkey": name,
"vdom": "global",
"type": "CertKey",
"passwd": password,
}
for field, value := range fields {
err := w.WriteField(field, value)
if err != nil {
return &b, contentType, err
}
}

certPart, err := w.CreateFormFile("cert", "tls.crt")
if err != nil {
Expand Down

0 comments on commit 420a8ce

Please sign in to comment.