Add editorconfig and run goimports
This commit is contained in:
parent
48780ed0d2
commit
1f27d47a64
21
.editorconfig
Normal file
21
.editorconfig
Normal file
@ -0,0 +1,21 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.go]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
ij_go_add_parentheses_for_single_import = true
|
||||
ij_go_GROUP_CURRENT_PROJECT_IMPORTS = true
|
||||
ij_go_group_stdlib_imports = true
|
||||
ij_go_import_sorting = goimports
|
||||
ij_go_local_group_mode = project
|
||||
ij_go_local_package_prefixes = "github.com/signalapp/svr2"
|
||||
ij_go_move_all_imports_in_one_declaration = true
|
||||
ij_go_move_all_stdlib_imports_in_one_group = true
|
||||
@ -14,11 +14,12 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/web/client"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/web/client"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/web/client"
|
||||
|
||||
|
||||
@ -25,9 +25,10 @@ import (
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/gtank/ristretto255"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/web/client"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -10,10 +10,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/signalapp/svr2/util"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/signalapp/svr2/util"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
||||
@ -11,13 +11,14 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/util"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -5,9 +5,10 @@ package dispatch
|
||||
|
||||
import (
|
||||
"github.com/google/go-cmp/cmp"
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
type mockMetricsWriter struct {
|
||||
|
||||
@ -5,7 +5,6 @@ package enclave
|
||||
|
||||
import (
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -52,9 +52,10 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -14,9 +14,10 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/mdlayher/vsock"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -23,11 +23,12 @@ import (
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
"github.com/gorilla/websocket"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/servicetest"
|
||||
"github.com/signalapp/svr2/web/client"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -7,9 +7,10 @@ package logger
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
)
|
||||
|
||||
// init sets up reasonable logging defaults for tests / non-main
|
||||
|
||||
@ -10,23 +10,23 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"time"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
"github.com/hashicorp/go-metrics/datadog"
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/enclave"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/service"
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
|
||||
stdlog "log"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -14,11 +14,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/go-metrics"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/util"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -14,11 +14,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/util"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
"github.com/signalapp/svr2/util"
|
||||
|
||||
@ -11,11 +11,12 @@ import (
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
metrics "github.com/hashicorp/go-metrics"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import (
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/peerid"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
|
||||
"github.com/go-redis/redis_rate/v10"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
)
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
)
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
"github.com/signalapp/svr2/servicetest"
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
|
||||
"github.com/signalapp/svr2/servicetest"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -10,11 +10,15 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/dispatch"
|
||||
@ -28,11 +32,8 @@ import (
|
||||
"github.com/signalapp/svr2/util"
|
||||
"github.com/signalapp/svr2/web/handlers"
|
||||
"github.com/signalapp/svr2/web/middleware"
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
_ "net/http/pprof"
|
||||
)
|
||||
|
||||
// Start starts all SVR components and only returns when a component has encountered an
|
||||
|
||||
@ -16,13 +16,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
"github.com/alicebob/miniredis/v2"
|
||||
"github.com/gorilla/websocket"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/enclave"
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
"github.com/signalapp/svr2/util"
|
||||
"github.com/signalapp/svr2/web/client"
|
||||
|
||||
|
||||
@ -9,9 +9,10 @@ import (
|
||||
"mime"
|
||||
"net/http"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/peer/peerdb"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -6,6 +6,7 @@ package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -10,9 +10,10 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -11,9 +11,10 @@ import (
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
|
||||
@ -11,10 +11,11 @@ import (
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/hashicorp/go-metrics"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/util"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
@ -4,9 +4,10 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/signalapp/svr2/auth"
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AuthCheck wraps an http.Handler to check the request's BasicAuth using the provided authenticator
|
||||
|
||||
@ -11,6 +11,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/go-metrics"
|
||||
|
||||
"github.com/signalapp/svr2/util"
|
||||
)
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/go-metrics"
|
||||
|
||||
"github.com/signalapp/svr2/logger"
|
||||
"github.com/signalapp/svr2/rate"
|
||||
)
|
||||
|
||||
@ -15,11 +15,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/signalapp/svr2/config"
|
||||
"github.com/signalapp/svr2/dispatch"
|
||||
"github.com/signalapp/svr2/util"
|
||||
"github.com/signalapp/svr2/web/handlers"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
pb "github.com/signalapp/svr2/proto"
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user