From 1af1c0a13235af4a0a3653bcf5e49aad35361446 Mon Sep 17 00:00:00 2001 From: william harbert Date: Sat, 19 Jul 2025 13:12:35 -0400 Subject: [PATCH] init --- .gitignore | 0 .vscode/launch.json | 17 +++++++++++++++++ README.md | 25 +++++++++++++++++++++++++ cmd/app1/main.go | 12 ++++++++++++ internal/pkg1/pkg1.go | 1 + internal/pkg1/pkg1_test.go | 1 + 6 files changed, 56 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/launch.json create mode 100644 README.md create mode 100644 cmd/app1/main.go create mode 100644 internal/pkg1/pkg1.go create mode 100644 internal/pkg1/pkg1_test.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b58349b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug cmd/web", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/cmd/app1", + //"showLog": true, + "cwd": "${workspaceFolder}", + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..8180547 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Go Application Template + +## Structure +my-app/ +├── cmd/ +│ └── app1/ # Individual target binary. Duplicate as needed +│ ├── app1.go +│ └── app1_test.go +└── internal/ + └── pkg1/ # Internal use package. Duplicate as needed + ├── pgk1.go + └── pgk1_test.go + +## Use +- `git clone git.develent.net/wiharb/go-template-app.git` +- `rm -rf ./.git` +- Rename and duplicate `cmd/app1` and `internal/pkg1` as needed +- `go mod init [package_name]` +- Update `./.vscode/launch.json::"program"` to the correct binary path(s) +- Reinitialize git + - `git init` + - `git add .` + - `git commit -m "init"` + - `git remote add origin http://[user]:[token]@git.develenet.net/wiharb/[repo].git` + - `git push -u origin master` diff --git a/cmd/app1/main.go b/cmd/app1/main.go new file mode 100644 index 0000000..f72ecba --- /dev/null +++ b/cmd/app1/main.go @@ -0,0 +1,12 @@ +package main + +import ( + "fmt" +) + +//go:generate + +func main() { + fmt.Println("App1") + +} diff --git a/internal/pkg1/pkg1.go b/internal/pkg1/pkg1.go new file mode 100644 index 0000000..f2aa7d4 --- /dev/null +++ b/internal/pkg1/pkg1.go @@ -0,0 +1 @@ +package pkg1 diff --git a/internal/pkg1/pkg1_test.go b/internal/pkg1/pkg1_test.go new file mode 100644 index 0000000..f2aa7d4 --- /dev/null +++ b/internal/pkg1/pkg1_test.go @@ -0,0 +1 @@ +package pkg1