From 76c38d6bce29d646b24558d6d79251362d31aa5b Mon Sep 17 00:00:00 2001 From: "David R. Jenni" Date: Wed, 1 Mar 2017 12:46:37 +0100 Subject: [PATCH] x/tools/go/buildutil: remove unused function Found with honnef.co/go/tools/cmd/unused. Change-Id: I1dc8e4dbfd784bb22b2f0dabb7c1a08cf1ef44ee Reviewed-on: https://go-review.googlesource.com/37603 Reviewed-by: Alan Donovan --- go/buildutil/util.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/go/buildutil/util.go b/go/buildutil/util.go index 40c0f193..fc923d7a 100644 --- a/go/buildutil/util.go +++ b/go/buildutil/util.go @@ -15,7 +15,6 @@ import ( "os" "path" "path/filepath" - "runtime" "strings" ) @@ -79,14 +78,6 @@ func ContainingPackage(ctxt *build.Context, dir, filename string) (*build.Packag return nil, fmt.Errorf("can't find package containing %s", filename) } -// dirHasPrefix tests whether the directory dir begins with prefix. -func dirHasPrefix(dir, prefix string) bool { - if runtime.GOOS != "windows" { - return strings.HasPrefix(dir, prefix) - } - return len(dir) >= len(prefix) && strings.EqualFold(dir[:len(prefix)], prefix) -} - // -- Effective methods of file system interface ------------------------- // (go/build.Context defines these as methods, but does not export them.)