瀏覽代碼

renamed github flag to username based on feedback

master
alexkappa 9 年之前
父節點
當前提交
44d1b902ee
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. +4
    -5
      main.go

+ 4
- 5
main.go 查看文件

@@ -20,7 +20,7 @@ var httpsFlag = flag.String("https", "", "Serve HTTPS at given address")
var certFlag = flag.String("cert", "", "Use the provided TLS certificate")
var keyFlag = flag.String("key", "", "Use the provided TLS key")
var domainFlag = flag.String("domain", "gopkg.in", "Domain name")
var githubFlag = flag.String("github", "", "Github username")
var userFlag = flag.String("username", "", "Github username")

func main() {
if err := run(); err != nil {
@@ -81,14 +81,13 @@ type Repo struct {

// GitHubRoot returns the repository root at GitHub, without a schema.
func (repo *Repo) GitHubRoot() string {
if *githubFlag != "" {
return "github.com/" + *githubFlag + "/" + repo.Name
if *userFlag != "" {
return "github.com/" + *userFlag + "/" + repo.Name
}
if repo.User == "" {
return "github.com/go-" + repo.Name + "/" + repo.Name
} else {
return "github.com/" + repo.User + "/" + repo.Name
}
return "github.com/" + repo.User + "/" + repo.Name
}

// GopkgRoot returns the package root at gopkg.in, without a schema.


Loading…
取消
儲存