@ -34,6 +34,5 @@ jobs:
- name: Get dependencies, run test and static check
run: |
go test ./...
go vet ./...
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck -- $(go list ./...)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run --disable-all -E govet -E gofumpt -E megacheck ./...
@ -151,5 +151,8 @@ all-arch: $(UNIX_ARCH_LIST) $(WINDOWS_ARCH_LIST)
releases: $(unix_releases) $(windows_releases)
lint:
clean:
rm -rf $(BUILD_DIR)
@ -38,7 +38,7 @@ func TestObservable_MultiSubscribe(t *testing.T) {
src := NewObservable(iter)
ch1, _ := src.Subscribe()
ch2, _ := src.Subscribe()
var count = atomic.NewInt32(0)
count := atomic.NewInt32(0)
var wg sync.WaitGroup
wg.Add(2)
@ -52,6 +52,7 @@ func (alloc *Allocator) Put(buf []byte) error {
}
//lint:ignore SA6002 ignore temporarily
//nolint
alloc.buffers[b].Put(buf)
return nil
@ -8,9 +8,7 @@ import (
type controlFunc func(string, string, syscall.RawConn) error
var (
_controlPool = make([]controlFunc, 0, 2)
)
var _controlPool = make([]controlFunc, 0, 2)
func addControl(f controlFunc) {
_controlPool = append(_controlPool, f)
@ -7,10 +7,8 @@ import (
"go.uber.org/atomic"
// _defaultLevel is package default logging level.
_defaultLevel = atomic.NewUint32(uint32(InfoLevel))
var _defaultLevel = atomic.NewUint32(uint32(InfoLevel))
func init() {
logrus.SetOutput(os.Stdout)
@ -14,9 +14,7 @@ const (
tcpConnectTimeout = 5 * time.Second
_defaultDialer Dialer = &Base{}
var _defaultDialer Dialer = &Base{}
type Dialer interface {
DialContext(context.Context, *M.Metadata) (net.Conn, error)
@ -38,7 +38,7 @@ func NewSocks5(addr, user, pass string) (*Socks5, error) {
func (ss *Socks5) DialContext(ctx context.Context, metadata *M.Metadata) (c net.Conn, err error) {
var network = "tcp"
network := "tcp"
if ss.unix {
network = "unix"