Преглед изворни кода

Merge pull request #88 from slackhq/github-actions-gofmt

Add gofmt Github action
Wade Simmons пре 5 година
родитељ
комит
2f77dfa703

+ 29 - 0
.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

+ 1 - 1
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 {

+ 1 - 1
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

+ 1 - 1
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

+ 1 - 1
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"
 )
 

+ 1 - 1
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"
 )

+ 1 - 1
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

+ 1 - 1
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"
 )

+ 1 - 1
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"
 )

+ 1 - 1
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"
 )

+ 1 - 1
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"
 )