Refactoring (#17)
Reviewed-on: #17 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.25.4'
|
go-version: '1.25.4'
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender_models_deploy_key
|
echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender_models_deploy_key
|
||||||
chmod 600 ~/.ssh/textsender_models_deploy_key
|
chmod 600 ~/.ssh/textsender_models_deploy_key
|
||||||
ssh-keyscan ${{ vars.MY_HOST }} >> ~/.ssh/known_hosts
|
ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
eval $(ssh-agent -s)
|
eval $(ssh-agent -s)
|
||||||
ssh-add -v ~/.ssh/textsender_models_deploy_key
|
ssh-add -v ~/.ssh/textsender_models_deploy_key
|
||||||
|
|||||||
@@ -6,16 +6,17 @@ GO_VERSION ?= $(shell go version | awk '{print $$3}')
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
go build -ldflags="\
|
go build -ldflags="\
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.Version=$(VERSION)' \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.Version=$(VERSION)' \
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.BuildTime=$(BUILD_TIME)' \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.BuildTime=$(BUILD_TIME)' \
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.Commit=$(COMMIT)' \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.Commit=$(COMMIT)' \
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.GoVersion=$(GO_VERSION)'" \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.GoVersion=$(GO_VERSION)'" \
|
||||||
-o clean_file main.go
|
-o clean_file cmd/clean_file/main.go
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
go install -ldflags="\
|
go install -ldflags="\
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.Version=$(VERSION)' \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.Version=$(VERSION)' \
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.BuildTime=$(BUILD_TIME)' \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.BuildTime=$(BUILD_TIME)' \
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.Commit=$(COMMIT)' \
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.Commit=$(COMMIT)' \
|
||||||
-X 'git.kundeng.us/phoenix/clean_file/version.GoVersion=$(GO_VERSION)'"
|
-X 'git.kundeng.us/phoenix/clean_file/internal/version.GoVersion=$(GO_VERSION)'"
|
||||||
|
-o clean_file cmd/clean_file/main.go
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/clean_file/parser"
|
"git.kundeng.us/phoenix/clean_file/internal/parser"
|
||||||
"git.kundeng.us/phoenix/clean_file/version"
|
"git.kundeng.us/phoenix/clean_file/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -2,6 +2,6 @@ module git.kundeng.us/phoenix/clean_file
|
|||||||
|
|
||||||
go 1.25.4
|
go 1.25.4
|
||||||
|
|
||||||
require git.kundeng.us/phoenix/textsender-models v0.0.9
|
require git.kundeng.us/phoenix/textsender-models v0.0.10
|
||||||
|
|
||||||
require github.com/google/uuid v1.6.0 // indirect
|
require github.com/google/uuid v1.6.0 // indirect
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
git.kundeng.us/phoenix/textsender-models v0.0.9 h1:wHEbDLYzMpXQ8OaIf05xFY1V19iTpQogTJEuKInkjEQ=
|
git.kundeng.us/phoenix/textsender-models v0.0.10 h1:0AMe/zm4Xte2BcuqqhRP7+42m+4To+rUnHkR2a9eXlI=
|
||||||
git.kundeng.us/phoenix/textsender-models v0.0.9/go.mod h1:9iPDQJg1Tc6WMNoW5+f8YKmnosMwlWHJ++hmxNLDEe0=
|
git.kundeng.us/phoenix/textsender-models v0.0.10/go.mod h1:9iPDQJg1Tc6WMNoW5+f8YKmnosMwlWHJ++hmxNLDEe0=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
const Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
@@ -4,10 +4,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Test_File_Path = "../tests/numbers.txt"
|
const Test_File_Path = "../../tests/numbers.txt"
|
||||||
|
|
||||||
// Remove duplicates
|
// Remove duplicates
|
||||||
func Test_RemoveDups(t *testing.T) {
|
func Test_RemoveDups(t *testing.T) {
|
||||||
Reference in New Issue
Block a user