Skip to content

Commit 098d716

Browse files
committed
fix: change directory structure for imports to work, move config to pkg
1 parent af621c5 commit 098d716

File tree

22 files changed

+20
-22
lines changed

22 files changed

+20
-22
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Go
3737
uses: actions/setup-go@v6
3838
with:
39-
go-version-file: 'src/go.mod'
39+
go-version-file: 'go.mod'
4040
cache: true
4141

4242
- name: Restore Go Cache
@@ -50,9 +50,7 @@ jobs:
5050
${{ runner.os }}-go-
5151
5252
- name: Download module-dependencies
53-
run: |
54-
cd src/
55-
go mod tidy
53+
run: go mod tidy
5654

5755
# NOTE: not using 'golangci/golangci-lint-action' because of warn/error split
5856
- name: Install dependencies

.github/workflows/unit_test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Go
3535
uses: actions/setup-go@v6
3636
with:
37-
go-version-file: 'src/go.mod'
37+
go-version-file: 'go.mod'
3838
cache: true
3939

4040
- name: Restore Go Cache
@@ -53,9 +53,7 @@ jobs:
5353
go install gotest.tools/gotestsum@latest
5454
5555
- name: Download module-dependencies
56-
run: |
57-
cd src/
58-
go mod tidy
56+
run: go mod tidy
5957

6058
- name: Building Go Binary
6159
run: bash scripts/build.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This client enables you to supply a simple configuration-file that will request
3434

3535
```bash
3636
mkdir $REPO/build
37-
cd $REPO/src
37+
cd $REPO
3838
go mod tidy # download dependencies
3939
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o "../build/acme" ./cmd/main.go
4040
```

src/cmd/main.go renamed to cmd/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import (
55
"fmt"
66
"os"
77
"path/filepath"
8+
"time"
89

910
"git.oxl.at/acme-client/internal/acme"
10-
"git.oxl.at/acme-client/internal/config"
1111
"git.oxl.at/acme-client/internal/manager"
1212
"git.oxl.at/acme-client/internal/u"
13+
"git.oxl.at/acme-client/pkg/config"
1314
"git.oxl.at/go-validator/pkg/validate"
1415
)
1516

@@ -97,5 +98,7 @@ func main() {
9798
return
9899
}
99100

101+
config.RenewalDays = time.Duration(config.Config.RenewalDays) * 24 * time.Hour
102+
100103
manager.Run()
101104
}
File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"strconv"
1515
"time"
1616

17-
"git.oxl.at/acme-client/internal/config"
17+
"git.oxl.at/acme-client/pkg/config"
1818
)
1919

2020
func NeedsUpdate(baseName string, desired []string) (bool, string) {
@@ -72,7 +72,7 @@ func NeedsUpdate(baseName string, desired []string) (bool, string) {
7272
return true, "expired"
7373
}
7474

75-
if time.Until(cert.NotAfter) < config.RENEWAL_DAYS*24*time.Hour {
75+
if time.Until(cert.NotAfter) < config.RenewalDays {
7676
return true, "expiring soon"
7777
}
7878

0 commit comments

Comments
 (0)