Skip to content

Commit 621dd0e

Browse files
authored
License update and group imports (polarismesh#92)
* update license * reformat go imports
1 parent ddb9245 commit 621dd0e

File tree

19 files changed

+34
-40
lines changed

19 files changed

+34
-40
lines changed

LICENSE

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ Copyright (c) 2008 Jesse Beder.
294294
11. murmurhash
295295
Copyright murmurhash authors and contributors
296296

297+
12. regexp2
298+
Copyright (c) Doug Clark
299+
297300
Terms of the MIT License:
298301
---------------------------------------------------
299302
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

benchmark/benchmain/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ func runModesFromWorkloads(workload string) runModes {
100100
}
101101

102102
type startFunc func(mode string, bf stats.Features)
103+
103104
type stopFunc func(count uint64)
105+
104106
type rpcCallFunc func(pos int, ctx *runContext)
107+
105108
type rpcCleanupFunc func()
106109

107110
// benchOpts represents all configurable options available while running this

examples/services/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ package main
1919

2020
import (
2121
"fmt"
22+
"log"
2223

2324
"github.com/polarismesh/polaris-go"
2425
"github.com/polarismesh/polaris-go/pkg/model"
25-
"log"
2626
)
2727

2828
func main() {

pkg/model/pb/rule.go

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package pb
1919

2020
import (
2121
"fmt"
22-
2322
"sync/atomic"
2423

2524
regexp "github.com/dlclark/regexp2"

pkg/model/service.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ import (
2424
"time"
2525

2626
"github.com/golang/protobuf/proto"
27-
"github.com/modern-go/reflect2"
28-
2927
"github.com/hashicorp/go-multierror"
28+
"github.com/modern-go/reflect2"
3029
)
3130

3231
// RunMode SDK的运行模式,可以指定为agent或者no-agent模式

pkg/plugin/healthcheck/healthcheck.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ package healthcheck
2020
import (
2121
"time"
2222

23+
"github.com/polarismesh/polaris-go/pkg/model"
2324
"github.com/polarismesh/polaris-go/pkg/plugin"
2425
"github.com/polarismesh/polaris-go/pkg/plugin/common"
25-
26-
"github.com/polarismesh/polaris-go/pkg/model"
2726
)
2827

2928
// HealthChecker 【扩展点接口】主动健康探测策略

plugin/healthcheck/http/http.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ import (
2424

2525
"github.com/polarismesh/polaris-go/pkg/config"
2626
"github.com/polarismesh/polaris-go/pkg/log"
27+
"github.com/polarismesh/polaris-go/pkg/model"
2728
"github.com/polarismesh/polaris-go/pkg/plugin"
2829
"github.com/polarismesh/polaris-go/pkg/plugin/common"
29-
30-
"github.com/polarismesh/polaris-go/pkg/model"
3130
"github.com/polarismesh/polaris-go/pkg/plugin/healthcheck"
3231
"github.com/polarismesh/polaris-go/plugin/healthcheck/utils"
3332
)

plugin/healthcheck/tcp/tcp.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ import (
2323

2424
"github.com/polarismesh/polaris-go/pkg/config"
2525
"github.com/polarismesh/polaris-go/pkg/log"
26+
"github.com/polarismesh/polaris-go/pkg/model"
2627
"github.com/polarismesh/polaris-go/pkg/plugin"
2728
"github.com/polarismesh/polaris-go/pkg/plugin/common"
28-
29-
"github.com/polarismesh/polaris-go/pkg/model"
3029
"github.com/polarismesh/polaris-go/pkg/plugin/healthcheck"
3130
"github.com/polarismesh/polaris-go/plugin/healthcheck/utils"
3231
)

plugin/serverconnector/grpc/convert.go

-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
package grpc
1919

2020
import (
21-
// "github.com/polarismesh/polaris-go/pkg/model"
22-
// namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
2321
"github.com/polarismesh/polaris-go/plugin/serverconnector/common"
24-
// "github.com/golang/protobuf/ptypes/wrappers"
2522
)
2623

2724
var (

plugin/serverconnector/grpc/operation_async.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ import (
2121
"context"
2222
"time"
2323

24-
"github.com/polarismesh/polaris-go/pkg/log"
25-
connector "github.com/polarismesh/polaris-go/plugin/serverconnector/common"
26-
2724
"github.com/polarismesh/polaris-go/pkg/config"
25+
"github.com/polarismesh/polaris-go/pkg/log"
2826
"github.com/polarismesh/polaris-go/pkg/model"
2927
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
3028
"github.com/polarismesh/polaris-go/pkg/network"
3129
"github.com/polarismesh/polaris-go/pkg/plugin"
3230
"github.com/polarismesh/polaris-go/pkg/plugin/common"
3331
"github.com/polarismesh/polaris-go/pkg/plugin/serverconnector"
32+
connector "github.com/polarismesh/polaris-go/plugin/serverconnector/common"
3433
)
3534

3635
const (

plugin/serverconnector/sidecar/client/client.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ import (
2727
"github.com/polarismesh/polaris-go/pkg/log"
2828
"github.com/polarismesh/polaris-go/pkg/model"
2929
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
30+
"github.com/polarismesh/polaris-go/pkg/plugin"
3031
connector "github.com/polarismesh/polaris-go/plugin/serverconnector/common"
3132
"github.com/polarismesh/polaris-go/plugin/serverconnector/sidecar/dns"
32-
33-
"github.com/polarismesh/polaris-go/pkg/plugin"
3433
)
3534

3635
const (

plugin/serverconnector/sidecar/dns/question.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import (
2323
"errors"
2424
"strings"
2525

26-
v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
27-
2826
"github.com/golang/protobuf/proto"
27+
28+
v1 "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
2929
)
3030

3131
var TypeToQuestion = map[int]func() Question{

plugin/statreporter/tencent/monitor/utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const (
8181

8282
// 用于将sdkmetric计算出来的一维idx还原为多维数组的idx
8383
var reveseIdx = make([][]int, allIndexSize, allIndexSize)
84+
8485
var sdkDimensions = make([]int, allIndexSize)
8586

8687
const (

test/circuitbreak/healthcheck_suite.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,19 @@ import (
2626
"os"
2727
"time"
2828

29-
"github.com/polarismesh/polaris-go/pkg/config"
30-
"github.com/polarismesh/polaris-go/pkg/model/local"
31-
"github.com/polarismesh/polaris-go/test/mock"
32-
"github.com/polarismesh/polaris-go/test/util"
33-
3429
"github.com/golang/protobuf/ptypes/wrappers"
3530
"github.com/google/uuid"
3631
"google.golang.org/grpc"
3732
"gopkg.in/check.v1"
3833

3934
"github.com/polarismesh/polaris-go/api"
35+
"github.com/polarismesh/polaris-go/pkg/config"
4036
"github.com/polarismesh/polaris-go/pkg/model"
37+
"github.com/polarismesh/polaris-go/pkg/model/local"
4138
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
4239
"github.com/polarismesh/polaris-go/plugin/healthcheck/utils"
40+
"github.com/polarismesh/polaris-go/test/mock"
41+
"github.com/polarismesh/polaris-go/test/util"
4342
)
4443

4544
const (

test/serviceroute/nearbyRouting_suite.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ import (
2626
"strconv"
2727
"time"
2828

29-
"github.com/polarismesh/polaris-go/plugin/statreporter/tencent/serviceroute"
30-
"github.com/polarismesh/polaris-go/test/mock"
31-
"github.com/polarismesh/polaris-go/test/util"
32-
3329
"github.com/golang/protobuf/ptypes/wrappers"
3430
"github.com/google/uuid"
3531
"google.golang.org/grpc"
@@ -39,6 +35,9 @@ import (
3935
"github.com/polarismesh/polaris-go/pkg/config"
4036
"github.com/polarismesh/polaris-go/pkg/model"
4137
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
38+
"github.com/polarismesh/polaris-go/plugin/statreporter/tencent/serviceroute"
39+
"github.com/polarismesh/polaris-go/test/mock"
40+
"github.com/polarismesh/polaris-go/test/util"
4241
)
4342

4443
const (

test/serviceroute/ruleRouting_suite.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ import (
2929
"time"
3030

3131
"github.com/golang/protobuf/jsonpb"
32-
33-
monitorpb "github.com/polarismesh/polaris-go/plugin/statreporter/tencent/pb/v1"
34-
"github.com/polarismesh/polaris-go/test/mock"
35-
"github.com/polarismesh/polaris-go/test/util"
36-
3732
"github.com/golang/protobuf/ptypes/wrappers"
3833
"github.com/google/uuid"
3934
"google.golang.org/grpc"
@@ -43,6 +38,9 @@ import (
4338
"github.com/polarismesh/polaris-go/pkg/config"
4439
"github.com/polarismesh/polaris-go/pkg/model"
4540
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
41+
monitorpb "github.com/polarismesh/polaris-go/plugin/statreporter/tencent/pb/v1"
42+
"github.com/polarismesh/polaris-go/test/mock"
43+
"github.com/polarismesh/polaris-go/test/util"
4644
)
4745

4846
const (

test/serviceroute/setdivision_router_suite.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ import (
2323
"net"
2424
"time"
2525

26-
"github.com/polarismesh/polaris-go/plugin/statreporter/tencent/serviceroute"
27-
"github.com/polarismesh/polaris-go/test/mock"
28-
"github.com/polarismesh/polaris-go/test/util"
29-
3026
"github.com/golang/protobuf/ptypes/wrappers"
3127
"github.com/google/uuid"
3228
"google.golang.org/grpc"
@@ -36,6 +32,9 @@ import (
3632
"github.com/polarismesh/polaris-go/pkg/config"
3733
"github.com/polarismesh/polaris-go/pkg/model"
3834
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
35+
"github.com/polarismesh/polaris-go/plugin/statreporter/tencent/serviceroute"
36+
"github.com/polarismesh/polaris-go/test/mock"
37+
"github.com/polarismesh/polaris-go/test/util"
3938
)
4039

4140
const (

test/stability/cache_update_fast_suite.go

+3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ const (
4646
)
4747

4848
var testCacheSvcs = []string{"cacheUpdate1", "cacheUpdate2", "cacheUpdate3", "cacheUpdate4"}
49+
4950
var testCacheTokens = []string{"abf588ceee5b48bbb68ba69ef5f5347e", "5039fdecf0d54def9317fa30c01a5e05",
5051
"4591c171bed64672bf703613a2336bf2", "47812d435e294c7e937be901979867d6"}
52+
5153
var newCacheInstNums = []int{6, 10, 8, 5}
54+
5255
var testServices = make([]*namingpb.Service, 4, 4)
5356

5457
// 缓存持久化测试套件

test/subscribe/subscribe_suit.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ import (
2929
"github.com/golang/protobuf/ptypes/wrappers"
3030
"github.com/google/uuid"
3131
"google.golang.org/grpc"
32+
"gopkg.in/check.v1"
3233

3334
"github.com/polarismesh/polaris-go/api"
3435
"github.com/polarismesh/polaris-go/pkg/config"
3536
"github.com/polarismesh/polaris-go/pkg/model"
3637
namingpb "github.com/polarismesh/polaris-go/pkg/model/pb/v1"
3738
"github.com/polarismesh/polaris-go/test/mock"
3839
"github.com/polarismesh/polaris-go/test/util"
39-
40-
"gopkg.in/check.v1"
4140
)
4241

4342
const (

0 commit comments

Comments
 (0)