Skip to content

Commit 0b0917d

Browse files
committed
subcommand: make 'run()' public by renaming to 'Run()'
Make the 'run()' function public (by capitalizing it as 'Run()') so that, when 'Subcommand' is moved into an external package, it can be implemented by the commands in 'git-bundle-server'. Signed-off-by: Victoria Dye <[email protected]>
1 parent 90a0737 commit 0b0917d

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

cmd/git-bundle-server/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Remove the configuration for the given '<route>' and delete its repository
1919
data.`
2020
}
2121

22-
func (Delete) run(args []string) error {
22+
func (Delete) Run(args []string) error {
2323
if len(args) < 1 {
2424
return errors.New("usage: git-bundle-server delete <route>")
2525
}

cmd/git-bundle-server/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Initialize a repository by cloning a bare repo from '<url>', whose bundles
2121
should be hosted at '<route>'.`
2222
}
2323

24-
func (Init) run(args []string) error {
24+
func (Init) Run(args []string) error {
2525
if len(args) < 2 {
2626
// TODO: allow parsing <route> out of <url>
2727
return errors.New("usage: git-bundle-server init <url> <route>")

cmd/git-bundle-server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515

1616
for i := 0; i < len(cmds); i++ {
1717
if cmds[i].Name() == os.Args[1] {
18-
err := cmds[i].run(os.Args[2:])
18+
err := cmds[i].Run(os.Args[2:])
1919
if err != nil {
2020
log.Fatal("Failed with error: ", err)
2121
}

cmd/git-bundle-server/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Start computing bundles and serving content for the repository at the
2020
specified '<route>'.`
2121
}
2222

23-
func (Start) run(args []string) error {
23+
func (Start) Run(args []string) error {
2424
if len(args) < 1 {
2525
return errors.New("usage: git-bundle-server start <route>")
2626
}

cmd/git-bundle-server/stop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Stop computing bundles or serving content for the repository at the
1818
specified '<route>'.`
1919
}
2020

21-
func (Stop) run(args []string) error {
21+
func (Stop) Run(args []string) error {
2222
if len(args) < 1 {
2323
return errors.New("usage: git-bundle-server stop <route>")
2424
}

cmd/git-bundle-server/subcommand.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
type Subcommand interface {
44
Name() string
55
Description() string
6-
run(args []string) error
6+
Run(args []string) error
77
}
88

99
func all() []Subcommand {

cmd/git-bundle-server/update-all.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (UpdateAll) Description() string {
1919
For every configured route, run 'git-bundle-server update <options> <route>'.`
2020
}
2121

22-
func (UpdateAll) run(args []string) error {
22+
func (UpdateAll) Run(args []string) error {
2323
exe, err := os.Executable()
2424
if err != nil {
2525
return fmt.Errorf("failed to get path to execuable: %w", err)

cmd/git-bundle-server/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ For the repository in the current directory (or the one specified by
2121
bundles, and update the bundle list.`
2222
}
2323

24-
func (Update) run(args []string) error {
24+
func (Update) Run(args []string) error {
2525
if len(args) != 1 {
2626
// TODO: allow parsing <route> out of <url>
2727
return errors.New("usage: git-bundle-server update <route>")

0 commit comments

Comments
 (0)