Skip to content

Commit

Permalink
fix:修复就近路由demo配置文件不对问题 (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Sep 6, 2023
1 parent af2f4dc commit 6dfa42a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/route/nearby/provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/polarismesh/specification v1.3.2-alpha.2 // indirect
github.com/polarismesh/specification v1.4.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions examples/route/nearby/provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/polarismesh/specification v1.3.2-alpha.2 h1:cMghyvCnRVM5ca2kYCGHOgIIxVnokiMvw0720q8a8RA=
github.com/polarismesh/specification v1.3.2-alpha.2/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
github.com/polarismesh/specification v1.4.0 h1:fm7sUtFZC2g9+lLmRCtjGrUow47CY5JDFoZXwwCQGGY=
github.com/polarismesh/specification v1.4.0/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
Expand Down
9 changes: 5 additions & 4 deletions examples/route/nearby/provider/polaris.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
global:
serverConnector:
addresses:
- 127.0.0.1:8091
- 119.91.66.223:8091
# 地址提供插件,用于获取当前SDK所在的地域信息
location:
providers:
- type: local
region: ${REGION}
zone: ${ZONE}
campus: ${CAMPUS}
options:
region: ${REGION}
zone: ${ZONE}
campus: ${CAMPUS}
#描述:主调端配置
statReporter:
enable: true
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/location_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ func (l LocationProviderConfigImpl) Verify() error {
}

func (l LocationProviderConfigImpl) SetDefault() {
if len(l.Options) == 0 {
l.Options = map[string]interface{}{}

Check failure on line 46 in pkg/config/location_provider.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.16.x)

SA4005: ineffective assignment to field LocationProviderConfigImpl.Options (staticcheck)

Check failure on line 46 in pkg/config/location_provider.go

View workflow job for this annotation

GitHub Actions / golangci-lint (1.15.x)

SA4005: ineffective assignment to field LocationProviderConfigImpl.Options (staticcheck)
}
}

0 comments on commit 6dfa42a

Please sign in to comment.