引用第三方库

This commit is contained in:
2023-12-21 11:35:10 +08:00
parent 695d1993f9
commit f0179fed9a
2 changed files with 14 additions and 0 deletions

5
go.mod
View File

@@ -1,3 +1,8 @@
module simple-go-action
go 1.21.1
require (
github.com/sethvargo/go-envconfig v0.8.0 // indirect
github.com/sethvargo/go-githubactions v1.1.0 // indirect
)

View File

@@ -4,9 +4,18 @@ import (
"fmt"
"os"
"time"
gha "github.com/sethvargo/go-githubactions"
)
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()
fmt.Printf("username is %s\n", username)