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

Add gofmt Github action
This commit is contained in:
Wade Simmons 2019-12-11 23:22:45 -05:00 committed by GitHub
commit 2f77dfa703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 39 additions and 10 deletions

29
.github/workflows/gofmt.yml vendored Normal file
View File

@ -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

View File

@ -10,8 +10,8 @@ import (
"strings" "strings"
"time" "time"
"golang.org/x/crypto/ed25519"
"github.com/slackhq/nebula/cert" "github.com/slackhq/nebula/cert"
"golang.org/x/crypto/ed25519"
) )
type caFlags struct { type caFlags struct {

View File

@ -9,8 +9,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/assert"
"github.com/slackhq/nebula/cert" "github.com/slackhq/nebula/cert"
"github.com/stretchr/testify/assert"
) )
//TODO: test file permissions //TODO: test file permissions

View File

@ -6,8 +6,8 @@ import (
"os" "os"
"testing" "testing"
"github.com/stretchr/testify/assert"
"github.com/slackhq/nebula/cert" "github.com/slackhq/nebula/cert"
"github.com/stretchr/testify/assert"
) )
//TODO: test file permissions //TODO: test file permissions

View File

@ -4,10 +4,10 @@ import (
"encoding/json" "encoding/json"
"flag" "flag"
"fmt" "fmt"
"github.com/slackhq/nebula/cert"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"github.com/slackhq/nebula/cert"
"strings" "strings"
) )

View File

@ -2,10 +2,10 @@ package main
import ( import (
"bytes" "bytes"
"github.com/slackhq/nebula/cert"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"io/ioutil" "io/ioutil"
"os" "os"
"github.com/slackhq/nebula/cert"
"testing" "testing"
"time" "time"
) )

View File

@ -10,9 +10,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/slackhq/nebula/cert"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"golang.org/x/crypto/ed25519" "golang.org/x/crypto/ed25519"
"github.com/slackhq/nebula/cert"
) )
//TODO: test file permissions //TODO: test file permissions

View File

@ -3,10 +3,10 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"github.com/slackhq/nebula/cert"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"github.com/slackhq/nebula/cert"
"strings" "strings"
"time" "time"
) )

View File

@ -3,11 +3,11 @@ package main
import ( import (
"bytes" "bytes"
"crypto/rand" "crypto/rand"
"github.com/slackhq/nebula/cert"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"golang.org/x/crypto/ed25519" "golang.org/x/crypto/ed25519"
"io/ioutil" "io/ioutil"
"os" "os"
"github.com/slackhq/nebula/cert"
"testing" "testing"
"time" "time"
) )

View File

@ -4,10 +4,10 @@ import (
"encoding/binary" "encoding/binary"
"errors" "errors"
"github.com/rcrowley/go-metrics" "github.com/rcrowley/go-metrics"
"github.com/slackhq/nebula/cert"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"math" "math"
"net" "net"
"github.com/slackhq/nebula/cert"
"testing" "testing"
"time" "time"
) )

2
ssh.go
View File

@ -6,12 +6,12 @@ import (
"flag" "flag"
"fmt" "fmt"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/slackhq/nebula/sshd"
"io/ioutil" "io/ioutil"
"net" "net"
"os" "os"
"reflect" "reflect"
"runtime/pprof" "runtime/pprof"
"github.com/slackhq/nebula/sshd"
"strings" "strings"
"syscall" "syscall"
) )