Skip to content

Commit

Permalink
Rebase and respond to Doug's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zasweq committed Jan 23, 2023
1 parent 15aefc9 commit f9905ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions gcp/observability/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ func fetchDefaultProjectID(ctx context.Context) string {
// validateMethodString validates whether the string passed in is a valid
// pattern.
func validateMethodString(method string) error {
if method == "*" {
return nil
}
if strings.HasPrefix(method, "/") {
return errors.New("cannot have a leading slash")
}
Expand Down
2 changes: 1 addition & 1 deletion gcp/observability/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func (bl *binaryLogger) GetMethodLogger(methodName string) iblog.MethodLogger {
// parseMethod splits service and method from the input. It expects format
// "service/method".
func parseMethod(method string) (string, string, error) {
pos := strings.LastIndex(method, "/")
pos := strings.Index(method, "/")
if pos < 0 {
// Shouldn't happen, config already validated.
return "", "", errors.New("invalid method name: no / found")
Expand Down

0 comments on commit f9905ea

Please sign in to comment.