cleanup: more simplifications (#2574)
This commit is contained in:
@ -96,10 +96,7 @@ func valid(authorization []string) bool {
|
||||
// Perform the token validation here. For the sake of this example, the code
|
||||
// here forgoes any of the usual OAuth2 token validation and instead checks
|
||||
// for a token matching an arbitrary string.
|
||||
if token != "some-secret-token" {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return token == "some-secret-token"
|
||||
}
|
||||
|
||||
// ensureValidToken ensures a valid token exists within a request's metadata. If
|
||||
|
@ -89,10 +89,7 @@ func valid(authorization []string) bool {
|
||||
// Perform the token validation here. For the sake of this example, the code
|
||||
// here forgoes any of the usual OAuth2 token validation and instead checks
|
||||
// for a token matching an arbitrary string.
|
||||
if token != "some-secret-token" {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return token == "some-secret-token"
|
||||
}
|
||||
|
||||
func unaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
||||
|
@ -111,7 +111,7 @@ type exampleResolver struct {
|
||||
|
||||
func (r *exampleResolver) start() {
|
||||
addrStrs := r.addrsStore[r.target.Endpoint]
|
||||
addrs := make([]resolver.Address, len(addrStrs), len(addrStrs))
|
||||
addrs := make([]resolver.Address, len(addrStrs))
|
||||
for i, s := range addrStrs {
|
||||
addrs[i] = resolver.Address{Addr: s}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ type exampleResolver struct {
|
||||
|
||||
func (r *exampleResolver) start() {
|
||||
addrStrs := r.addrsStore[r.target.Endpoint]
|
||||
addrs := make([]resolver.Address, len(addrStrs), len(addrStrs))
|
||||
addrs := make([]resolver.Address, len(addrStrs))
|
||||
for i, s := range addrStrs {
|
||||
addrs[i] = resolver.Address{Addr: s}
|
||||
}
|
||||
|
Reference in New Issue
Block a user