zhaoyunxing92 commented on a change in pull request #1626:
URL: https://github.com/apache/dubbo-go/pull/1626#discussion_r760163409
##########
File path: config/config_loader_options.go
##########
@@ -155,11 +161,11 @@ func userHomeDir() string {
// checkGenre check Genre
func checkGenre(genre string) error {
- genres := []string{"json", "toml", "yaml", "yml"}
+ genres := []string{"json", "toml", "yaml", "yml", "properties"}
sort.Strings(genres)
idx := sort.SearchStrings(genres, genre)
if genres[idx] != genre {
Review comment:
源码里面就是一个二分搜索,不会存在`-1`的情况
```go
func Search(n int, f func(int) bool) int {
// Define f(-1) == false and f(n) == true.
// Invariant: f(i-1) == false, f(j) == true.
i, j := 0, n
for i < j {
h := int(uint(i+j) >> 1) // avoid overflow when computing h
// i ≤ h < j
if !f(h) {
i = h + 1 // preserves f(i-1) == false
} else {
j = h // preserves f(j) == true
}
}
// i == j, f(i-1) == false, and f(j) (= f(i)) == true => answer is i.
return i
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]