// Copyright 2013 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 or at // https://developers.google.com/open-source/licenses/bsd. package gosrc import ( "errors" "net/http" "net/url" "regexp" "strings" ) func init() { addService(&service{ pattern: regexp.MustCompile(`^code\.google\.com/(?P[pr])/(?P[a-z0-9\-]+)(:?\.(?P[a-z0-9\-]+))?(?P/[a-z0-9A-Z_.\-/]+)?$`), prefix: "code.google.com/", get: getGoogleDir, getPresentation: getGooglePresentation, }) } var ( googleRepoRe = regexp.MustCompile(`id="checkoutcmd">(hg|git|svn)`) googleRevisionRe = regexp.MustCompile(`

(?:[^ ]+ - )?Revision *([^:]+):`) googleEtagRe = regexp.MustCompile(`^(hg|git|svn)-`) googleFileRe = regexp.MustCompile(`