From 23b8c7b4eab0375b3d59cf4b2a1f3d7356515f95 Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Sun, 11 Feb 2018 20:34:07 -0800 Subject: vendor: include source for tools This change vendors the source for all our build, formatting, and linting tools. Generated by running "dep ensure". --- .../kisielk/gotool/internal/load/path.go | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vendor/github.com/kisielk/gotool/internal/load/path.go (limited to 'vendor/github.com/kisielk/gotool/internal/load/path.go') diff --git a/vendor/github.com/kisielk/gotool/internal/load/path.go b/vendor/github.com/kisielk/gotool/internal/load/path.go new file mode 100644 index 0000000..74e15b9 --- /dev/null +++ b/vendor/github.com/kisielk/gotool/internal/load/path.go @@ -0,0 +1,27 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.9 + +package load + +import ( + "strings" +) + +// hasPathPrefix reports whether the path s begins with the +// elements in prefix. +func hasPathPrefix(s, prefix string) bool { + switch { + default: + return false + case len(s) == len(prefix): + return s == prefix + case len(s) > len(prefix): + if prefix != "" && prefix[len(prefix)-1] == '/' { + return strings.HasPrefix(s, prefix) + } + return s[len(prefix)] == '/' && s[:len(prefix)] == prefix + } +} -- cgit v1.2.3