引用第三方库
This commit is contained in:
5
go.mod
5
go.mod
@@ -1,3 +1,8 @@
|
|||||||
module simple-go-action
|
module simple-go-action
|
||||||
|
|
||||||
go 1.21.1
|
go 1.21.1
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/sethvargo/go-envconfig v0.8.0 // indirect
|
||||||
|
github.com/sethvargo/go-githubactions v1.1.0 // indirect
|
||||||
|
)
|
||||||
|
|||||||
9
main.go
9
main.go
@@ -4,9 +4,18 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
gha "github.com/sethvargo/go-githubactions"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
username := gha.GetInput("username")
|
||||||
|
fmt.Printf("username is %s\n", username)
|
||||||
|
|
||||||
|
gha.SetOutput("time", time.Now().Format("2006-01-02 15:04:05"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func old_version() {
|
||||||
username := readInputs()
|
username := readInputs()
|
||||||
fmt.Printf("username is %s\n", username)
|
fmt.Printf("username is %s\n", username)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user