From 2d82db32a3cb0fc007c835bb3da99f43a3b9e9a8 Mon Sep 17 00:00:00 2001 From: Wade Simmons Date: Wed, 11 Dec 2019 22:31:35 -0500 Subject: [PATCH 1/2] Add gofmt Github action This runs gofmt and make sure no files need to be reformatted. --- .github/workflows/gofmt.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/gofmt.yml diff --git a/.github/workflows/gofmt.yml b/.github/workflows/gofmt.yml new file mode 100644 index 0000000..758a9c2 --- /dev/null +++ b/.github/workflows/gofmt.yml @@ -0,0 +1,29 @@ +name: gofmt +on: + push: + branches: + - master + pull_request: +jobs: + + gofmt: + name: Run gofmt + 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: gofmt + run: | + if [ "$(find . -iname '*.go' | xargs gofmt -l)" ] + then + find . -iname '*.go' | xargs gofmt -d + exit 1 + fi From df43f6466eee47e35147c5fcc549d0feba56e727 Mon Sep 17 00:00:00 2001 From: Wade Simmons Date: Wed, 11 Dec 2019 23:15:57 -0500 Subject: [PATCH 2/2] gofmt --- cmd/nebula-cert/ca.go | 2 +- cmd/nebula-cert/ca_test.go | 2 +- cmd/nebula-cert/keygen_test.go | 2 +- cmd/nebula-cert/print.go | 2 +- cmd/nebula-cert/print_test.go | 2 +- cmd/nebula-cert/sign_test.go | 2 +- cmd/nebula-cert/verify.go | 2 +- cmd/nebula-cert/verify_test.go | 2 +- firewall_test.go | 2 +- ssh.go | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/nebula-cert/ca.go b/cmd/nebula-cert/ca.go index bb96455..2a1486e 100644 --- a/cmd/nebula-cert/ca.go +++ b/cmd/nebula-cert/ca.go @@ -10,8 +10,8 @@ import ( "strings" "time" - "golang.org/x/crypto/ed25519" "github.com/slackhq/nebula/cert" + "golang.org/x/crypto/ed25519" ) type caFlags struct { diff --git a/cmd/nebula-cert/ca_test.go b/cmd/nebula-cert/ca_test.go index e8e20ae..6eb1e91 100644 --- a/cmd/nebula-cert/ca_test.go +++ b/cmd/nebula-cert/ca_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" "github.com/slackhq/nebula/cert" + "github.com/stretchr/testify/assert" ) //TODO: test file permissions diff --git a/cmd/nebula-cert/keygen_test.go b/cmd/nebula-cert/keygen_test.go index 9f02a37..52f71f5 100644 --- a/cmd/nebula-cert/keygen_test.go +++ b/cmd/nebula-cert/keygen_test.go @@ -6,8 +6,8 @@ import ( "os" "testing" - "github.com/stretchr/testify/assert" "github.com/slackhq/nebula/cert" + "github.com/stretchr/testify/assert" ) //TODO: test file permissions diff --git a/cmd/nebula-cert/print.go b/cmd/nebula-cert/print.go index 8ab747a..ebb3433 100644 --- a/cmd/nebula-cert/print.go +++ b/cmd/nebula-cert/print.go @@ -4,10 +4,10 @@ import ( "encoding/json" "flag" "fmt" + "github.com/slackhq/nebula/cert" "io" "io/ioutil" "os" - "github.com/slackhq/nebula/cert" "strings" ) diff --git a/cmd/nebula-cert/print_test.go b/cmd/nebula-cert/print_test.go index ddc5fff..7f8899a 100644 --- a/cmd/nebula-cert/print_test.go +++ b/cmd/nebula-cert/print_test.go @@ -2,10 +2,10 @@ package main import ( "bytes" + "github.com/slackhq/nebula/cert" "github.com/stretchr/testify/assert" "io/ioutil" "os" - "github.com/slackhq/nebula/cert" "testing" "time" ) diff --git a/cmd/nebula-cert/sign_test.go b/cmd/nebula-cert/sign_test.go index da49294..f8bf457 100644 --- a/cmd/nebula-cert/sign_test.go +++ b/cmd/nebula-cert/sign_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" + "github.com/slackhq/nebula/cert" "github.com/stretchr/testify/assert" "golang.org/x/crypto/ed25519" - "github.com/slackhq/nebula/cert" ) //TODO: test file permissions diff --git a/cmd/nebula-cert/verify.go b/cmd/nebula-cert/verify.go index 5574da4..d6a7174 100644 --- a/cmd/nebula-cert/verify.go +++ b/cmd/nebula-cert/verify.go @@ -3,10 +3,10 @@ package main import ( "flag" "fmt" + "github.com/slackhq/nebula/cert" "io" "io/ioutil" "os" - "github.com/slackhq/nebula/cert" "strings" "time" ) diff --git a/cmd/nebula-cert/verify_test.go b/cmd/nebula-cert/verify_test.go index 5722662..eb12a9b 100644 --- a/cmd/nebula-cert/verify_test.go +++ b/cmd/nebula-cert/verify_test.go @@ -3,11 +3,11 @@ package main import ( "bytes" "crypto/rand" + "github.com/slackhq/nebula/cert" "github.com/stretchr/testify/assert" "golang.org/x/crypto/ed25519" "io/ioutil" "os" - "github.com/slackhq/nebula/cert" "testing" "time" ) diff --git a/firewall_test.go b/firewall_test.go index a7c22bc..0a18254 100644 --- a/firewall_test.go +++ b/firewall_test.go @@ -4,10 +4,10 @@ import ( "encoding/binary" "errors" "github.com/rcrowley/go-metrics" + "github.com/slackhq/nebula/cert" "github.com/stretchr/testify/assert" "math" "net" - "github.com/slackhq/nebula/cert" "testing" "time" ) diff --git a/ssh.go b/ssh.go index 81846b8..9b1c88d 100644 --- a/ssh.go +++ b/ssh.go @@ -6,12 +6,12 @@ import ( "flag" "fmt" "github.com/sirupsen/logrus" + "github.com/slackhq/nebula/sshd" "io/ioutil" "net" "os" "reflect" "runtime/pprof" - "github.com/slackhq/nebula/sshd" "strings" "syscall" )