開発環境を構築する

This commit is contained in:
ry.yamafuji 2025-12-24 08:57:10 +09:00
parent 0f346a62f1
commit afe4113c2a
6 changed files with 74 additions and 1 deletions

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
App=skacksend
.PHONY: fmt vet test build run check
fmt:
go fmt ./...
vet:
go vet ./...
test:
go test -v ./...
build:
go build -o bin/$(App) ./cmd/$(App)
run:
go run ./cmd/$(App)
check: fmt vet test

View File

@ -1,3 +1,23 @@
# slacksend
Slackにメッセージを送信する
Slackにメッセージを送信する
## Dev
実行
```sh
go run ./cmd/slacksend
```
ビルド
```sh
go build -o slacksend ./cmd/slacksend
```
## init
```sh
go mod init gitea.pglikers.com/tools/slacksen
```

11
cmd/slacksend/main.go Normal file
View File

@ -0,0 +1,11 @@
package main
import "fmt"
func hello() string {
return "hello"
}
func main() {
fmt.Println(hello())
}

View File

@ -0,0 +1,12 @@
package main
import "testing"
func TestHello(t *testing.T) {
got := hello()
want := "hello"
if got != want {
t.Errorf("hello() = %q, want %q", got, want)
}
}

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module gitea.pglikers.com/tools/slacksen
go 1.25.5

7
readme/dev.md Normal file
View File

@ -0,0 +1,7 @@
# Go Dev
## Formatter
```sh
gofmt -w .
```