Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:修复就近路由demo配置文件不对问题 #170

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) 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.15.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.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.18.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.19.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.17.x)

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