🚚 Refactor project structure to follow standard Go layout conventions
This commit is contained in:
parent
c0007c291d
commit
ad7eba9b03
7 changed files with 5 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -122,6 +122,6 @@ Temporary Items
|
|||
*.icloud
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/go,linux,emacs,macos
|
||||
my-log
|
||||
/my-log
|
||||
cover.html
|
||||
cmd/test.go
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
- **Examples**: `✨ Add JSON export functionality for log entries`, `🐛 Fix date parsing for RFC3339 timestamps`, `📝 Update README with configuration examples`
|
||||
|
||||
## Project Structure
|
||||
- `cmd/`: Cobra commands (root, drop, config)
|
||||
- `cmd/my-log/`: Main application entrypoint
|
||||
- `internal/cmd/`: Cobra commands (root, drop, config)
|
||||
- `models/`: Core types (Entry, Log, Meta) with marshal/unmarshal implementations
|
||||
- `config/`: TOML-based configuration with env overrides
|
||||
- `formatters/`: Output formatters (plain, json, null)
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -47,4 +47,4 @@ open-report: $(COVERHTML) ## Open the coverage report in the default browser
|
|||
build: $(OUT) ## Builds the application
|
||||
|
||||
$(OUT): $(SOURCES) fmt
|
||||
go build -o $@
|
||||
go build -o $@ ./cmd/my-log
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
package main
|
||||
|
||||
import "codeberg.org/danjones000/my-log/cmd"
|
||||
import "codeberg.org/danjones000/my-log/internal/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
Loading…
Add table
Add a link
Reference in a new issue