init
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
@@ -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}",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
25
README.md
Normal file
25
README.md
Normal file
@@ -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`
|
||||||
1
internal/pkg1/pkg1.go
Normal file
1
internal/pkg1/pkg1.go
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package pkg1
|
||||||
1
internal/pkg1/pkg1_test.go
Normal file
1
internal/pkg1/pkg1_test.go
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package pkg1
|
||||||
9
lib1/lib1.go
Normal file
9
lib1/lib1.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package lib1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Function() {
|
||||||
|
fmt.Println("lib1")
|
||||||
|
}
|
||||||
1
lib1/lib1_test.go
Normal file
1
lib1/lib1_test.go
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package lib1
|
||||||
Reference in New Issue
Block a user