-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from tuan78/fix/cmd-installation
fix: issue of cmd installation
- Loading branch information
Showing
7 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/tuan78/jsonconv v1.0.2 h1:tdmVOQDrVrZZ+ZivgNuW8mYr1f7lsOajd+1BVm4QHVc= | ||
github.com/tuan78/jsonconv v1.0.2/go.mod h1:FFDL8xmSERH5fFmySGaR4ku/2RY0inkMZmhpBo8r9zc= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.PHONY: all | ||
all: build | ||
all: test | ||
|
||
.PHONY: build | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestMainFn_GoodArgs(t *testing.T) { | ||
os.Args = []string{"jsonconv", "--help"} | ||
main() | ||
} | ||
|
||
func TestMainFn_BadArgs(t *testing.T) { | ||
exitCode := 0 | ||
exitFn = func(code int) { exitCode = 1 } | ||
os.Args = []string{"jsonconv", "bad-args"} | ||
main() | ||
if exitCode == 0 { | ||
t.Errorf("it should exit with code 1 for bad args") | ||
} | ||
} |