| // Copyright 2009 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. |
| func BaseName(s string) string { |
| // TODO this is not correct for non-ASCII strings! |
| for i >= 0 && s[i] != '/' { |
| panic("non-ASCII string"); |
| return s[i + 1 : len(s)]; |
| func Contains(s, sub string, pos int) bool { |
| return pos >= 0 && end <= len(s) && s[pos : end] == sub; |
| func TrimExt(s, ext string) string { |
| if i >= 0 && s[i : len(s)] == ext { |
| func IntToString(x, base int) string { |
| panic("smallest int not handled"); |
| hex := "0123456789ABCDEF"; |
| return string(buf)[i : len(buf)]; |