-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed as not planned
Labels
Description
What is the URL of the page with the issue?
https://go.dev/play/p/5iv2wx09xc9
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Screenshot
What did you do?
During debugging my program, I've noticed this unexpected behavior.
What did you see happen?
func main() {
fmt.Println(strings.TrimLeft(
"/kubernetes/kubernetes/release-1.30/api/openapi-spec/v3/apis__authentication.k8s.io__v1_openapi.json",
"/kubernetes/kubernetes/release-1.30/api/openapi-spec/v3/",
))
// Expected: "apis__authentication.k8s.io__v1_openapi.json"
// Actual: "__authentication.k8s.io__v1_openapi.json"
}What did you expect to see?
Wrote in the "What did you see happen?" section.
Now I am using filepath.Base() instead.
https://go.dev/play/p/sIBOz9OmLuV
Reactions are currently unavailable
