mirror of
https://github.com/hanzoai/traces.git
synced 2026-11-03 04:05:45 +00:00
* Update prometheus/prometheus dependency and remove unnecessary replace directives I need a recent version of github.com/prometheus/prometheus for an upcoming metrics-generator PR. I replaced the version with v1.8.2-0.20220228151929-e25a59925555, this corresponds with [the latest release candidate](https://github.com/prometheus/prometheus/releases/tag/v2.34.0-rc.0). I noticed some of our replace directives are fairly old, so I've been deleting them until the build broke, not sure if there is a better way to do this 🤷 * Update go.mod in tempo-serverless as well * Lint: replace grpc.WithInsecure
32 lines
910 B
Go
32 lines
910 B
Go
/*
|
|
*
|
|
* Copyright 2021 gRPC authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
*/
|
|
|
|
package grpcutil
|
|
|
|
import "regexp"
|
|
|
|
// FullMatchWithRegex returns whether the full text matches the regex provided.
|
|
func FullMatchWithRegex(re *regexp.Regexp, text string) bool {
|
|
if len(text) == 0 {
|
|
return re.MatchString(text)
|
|
}
|
|
re.Longest()
|
|
rem := re.FindString(text)
|
|
return len(rem) == len(text)
|
|
}
|