-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
20 lines (17 loc) · 549 Bytes
/
Copy pathmain.go
File metadata and controls
20 lines (17 loc) · 549 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Package main implements a CLI tool to version and publish Go modules.
package main
import (
"io"
"os"
)
// main runs the goversion CLI and exits with its status code.
func main() {
os.Exit(run(os.Args[1:], os.Stdout, os.Stderr))
}
// run dispatches arguments to the publish or version command.
func run(arguments []string, output, errorOutput io.Writer) int {
if len(arguments) > 0 && arguments[0] == "publish" {
return runPublishCommand(arguments[1:], output, errorOutput)
}
return runVersionCommand(arguments, output, errorOutput)
}