Looks like your prefix and path are reversed: http://golang.org/pkg/strings/#HasPrefix