From 1a119ee406a1ac5a6e30872248929afd1569b516 Mon Sep 17 00:00:00 2001 From: william harbert Date: Sat, 19 Jul 2025 13:21:35 -0400 Subject: [PATCH] init --- .gitignore | 0 .vscode/launch.json | 17 +++++++++++++++++ README.md | 25 +++++++++++++++++++++++++ internal/pkg1/pkg1.go | 1 + internal/pkg1/pkg1_test.go | 1 + lib1/lib1.go | 9 +++++++++ lib1/lib1_test.go | 1 + 7 files changed, 54 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/launch.json create mode 100644 README.md create mode 100644 internal/pkg1/pkg1.go create mode 100644 internal/pkg1/pkg1_test.go create mode 100644 lib1/lib1.go create mode 100644 lib1/lib1_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..7ffaf15 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Go Application Template + +## Structure +my-lib/ +├── lib1/ # Individual importable library. Duplicate as needed +│ ├── lib1.go +│ └── lib1_test.go +└── internal/ + └── pkg1/ # Internal use package. Duplicate as needed + ├── pgk1.go + └── pgk1_test.go + +## Use +- `git clone git.develent.net/wiharb/go-template-lib.git [project-name]` +- `cd ./[project-name]` +- `rm -rf ./.git` +- Rename and duplicate `lib1` and `internal/pkg1` as needed +- `go mod init [package_name]` +- Update `./.vscode/launch.json::"program"` to the correct path(s); probably a lib test +- 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/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 diff --git a/lib1/lib1.go b/lib1/lib1.go new file mode 100644 index 0000000..b4ec8ff --- /dev/null +++ b/lib1/lib1.go @@ -0,0 +1,9 @@ +package lib1 + +import ( + "fmt" +) + +func Function() { + fmt.Println("lib1") +} diff --git a/lib1/lib1_test.go b/lib1/lib1_test.go new file mode 100644 index 0000000..beceb0e --- /dev/null +++ b/lib1/lib1_test.go @@ -0,0 +1 @@ +package lib1