Skip to content

Commit

Permalink
Merge pull request #5 from tongson/simple
Browse files Browse the repository at this point in the history
Simple project layout
  • Loading branch information
tongson authored Jun 12, 2021
2 parents 2aa0385 + 3323f5c commit dd6fbd2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 210 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.SILENT:
.SHELL := /usr/bin/env bash
.PHONY: staticcheck errcheck fmt build test clean
SRC= "cmd/rr/... internal/lib/..."
SRC= "main.go"
BOLD=$(shell tput bold)
RED=$(shell tput setaf 1)
GREEN=$(shell tput setaf 2)
Expand All @@ -22,8 +22,7 @@ setup:

fmt:
@echo "$(BLUE)$(TIME)$(GREEN) + go fmt $(RESET)"
@go fmt cmd/rr/main.go
@go fmt internal/lib/lib.go
@go fmt main.go

errcheck:
@echo "$(BLUE)$(TIME)$(GREEN) + errcheck $(RESET)"
Expand All @@ -35,7 +34,7 @@ staticcheck:

lint:
@echo "$(BLUE)$(TIME)$(GREEN) + golint $(RESET)"
bin/golint "cmd/rr/main.go"
bin/golint "main.go"

check: errcheck staticcheck lint
@echo "$(BLUE)$(TIME)$(GREEN) + CHECK DONE$(RESET)"
Expand All @@ -45,7 +44,7 @@ build: fmt
@echo "$(BLUE)$(TIME)$(GREEN) + BUILD START$(RESET)"
@mkdir -p bin
#@/usr/bin/env GOOS=linux go build -o bin/rr -ldflags="-s -w" ./...
@/usr/bin/env GOARCH=386 GOOS=linux CGO_ENABLED=0 go build -trimpath -o bin/rr -ldflags '-s -w' ./cmd/rr
@/usr/bin/env GOARCH=386 GOOS=linux CGO_ENABLED=0 go build -trimpath -o bin/rr -ldflags '-s -w'
@echo "$(BLUE)$(TIME)$(CYAN) ! BUILD DONE $(RESET)"

test:
Expand Down
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module rr

go 1.14
go 1.16

replace lib v1.0.0 => ./internal/lib

require lib v1.0.0
require github.com/tongson/gl v0.0.0-20210612034557-f2ffe6fda85c
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/tongson/gl v0.0.0-20210612034557-f2ffe6fda85c h1:Kxqn1XAeClmZLyfyIS7slyteXoB6yRfeLCcbIffGHU4=
github.com/tongson/gl v0.0.0-20210612034557-f2ffe6fda85c/go.mod h1:8rZKFhk3K0aIQLgYbfDbTkg5i1htgcxtIziuaW7hEsY=
1 change: 0 additions & 1 deletion internal/lib/go.mod

This file was deleted.

199 changes: 0 additions & 199 deletions internal/lib/lib.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/rr/main.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"lib"
lib "github.com/tongson/gl"
)

const versionNumber = "0.6.0"
Expand Down

0 comments on commit dd6fbd2

Please sign in to comment.