diff --git a/Taskfile.yaml b/Taskfile.yaml index 432fb86..07109b3 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -3,8 +3,12 @@ version: '3' tasks: default: cmds: - - task --list-all - silent: true + - go fmt . + - go vet . + - go clean . + - go run . + silent: false + install-hooks: cmds: - pip install pre-commit diff --git a/go.mod b/go.mod index 6f58d55..e7eaf80 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,18 @@ module stampy -go 1.18 +go 1.23.0 -require github.com/urfave/cli/v2 v2.27.4 +require ( + github.com/urfave/cli/v2 v2.27.4 + golang.design/x/clipboard v0.7.0 +) require ( github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect + golang.org/x/exp/shiny v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/image v0.19.0 // indirect + golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab // indirect + golang.org/x/sys v0.24.0 // indirect ) diff --git a/go.sum b/go.sum index 46bd4d8..f238404 100644 --- a/go.sum +++ b/go.sum @@ -6,3 +6,20 @@ github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= +golang.design/x/clipboard v0.7.0 h1:4Je8M/ys9AJumVnl8m+rZnIvstSnYj1fvzqYrU3TXvo= +golang.design/x/clipboard v0.7.0/go.mod h1:PQIvqYO9GP29yINEfsEn5zSQKAz3UgXmZKzDA6dnq2E= +golang.org/x/exp/shiny v0.0.0-20240823005443-9b4947da3948 h1:AoNpgfP7bIE9DPRTaIKpbhNusdi4mCPBmd1rsdnMyto= +golang.org/x/exp/shiny v0.0.0-20240823005443-9b4947da3948/go.mod h1:3F+MieQB7dRYLTmnncoFbb1crS5lfQoTfDgQy6K4N0o= +golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= +golang.org/x/image v0.19.0 h1:D9FX4QWkLfkeqaC62SonffIIuYdOk/UE2XKUBgRIBIQ= +golang.org/x/image v0.19.0/go.mod h1:y0zrRqlQRWQ5PXaYCOMLTW2fpsxZ8Qh9I/ohnInJEys= +golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a h1:sYbmY3FwUWCBTodZL1S3JUuOvaW6kM2o+clDzzDNBWg= +golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a/go.mod h1:Ede7gF0KGoHlj822RtphAHK1jLdrcuRBZg0sF1Q+SPc= +golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab h1:KONOFF8Uy3b60HEzOsGnNghORNhY4ImyOx0PGm73K9k= +golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab/go.mod h1:udWezQGYjqrCxz5nV321pXQTx5oGbZx+khZvFjZNOPM= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/main.go b/main.go index 6566bc6..d5f888a 100644 --- a/main.go +++ b/main.go @@ -1,22 +1,34 @@ package main import ( - "fmt" "log" + "log/slog" "os" "github.com/urfave/cli/v2" + + "golang.design/x/clipboard" ) +func greet() { + slog.Info("INFO!") +} + func main() { app := &cli.App{ Name: "greet", Usage: "fight the loneliness!", Action: func(*cli.Context) error { - fmt.Println("Hello friend!") + greet() + + clipboard.Write(clipboard.FmtText, []byte("text data")) return nil }, } + err := clipboard.Init() + if err != nil { + + } if err := app.Run(os.Args); err != nil { log.Fatal(err)