-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft: build multiple binaries and include them in one package (#160)
* feat: leverage go build feature to enable multiple binaries * chore: add multi-binaries test * doc: multiple binaries support * chore: enhance test * fix: multi test * fix: syntax * fix: tag * fix: build error * feat: add multi_binaries arg * test: more usage * fix: multi_binaries test * doc: update * fix: syntax
- Loading branch information
1 parent
588e24a
commit e48e16c
Showing
8 changed files
with
118 additions
and
15 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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
go.mod | ||
go.sum | ||
testmain | ||
cmd1 | ||
cmd2 |
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,26 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
const notSet string = "not set" | ||
|
||
// these information will be collected when build, by `-ldflags "-X main.gitCommit=06b8d24"` | ||
var ( | ||
buildTime = notSet | ||
gitCommit = notSet | ||
gitRef = notSet | ||
) | ||
|
||
func printVersion() { | ||
fmt.Printf("Build Time: %s\n", buildTime) | ||
fmt.Printf("Git Commit: %s\n", gitCommit) | ||
fmt.Printf("Git Ref: %s\n", gitRef) | ||
} | ||
|
||
func main() { | ||
fmt.Printf("%s Hello Action!\n", os.Args[0]) | ||
printVersion() | ||
} |
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,26 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
const notSet string = "not set" | ||
|
||
// these information will be collected when build, by `-ldflags "-X main.gitCommit=06b8d24"` | ||
var ( | ||
buildTime = notSet | ||
gitCommit = notSet | ||
gitRef = notSet | ||
) | ||
|
||
func printVersion() { | ||
fmt.Printf("Build Time: %s\n", buildTime) | ||
fmt.Printf("Git Commit: %s\n", gitCommit) | ||
fmt.Printf("Git Ref: %s\n", gitRef) | ||
} | ||
|
||
func main() { | ||
fmt.Printf("%s Hello Action!\n", os.Args[0]) | ||
printVersion() | ||
} |
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