Skip to content

Commit db727f4

Browse files
committed
remove unnecessary code generation steps
can now be replaced with mapstructure
1 parent 2984676 commit db727f4

File tree

4 files changed

+4
-275
lines changed

4 files changed

+4
-275
lines changed

.github/workflows/agent.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ jobs:
5555
- name: Set up Go
5656
uses: actions/setup-go@v5
5757
with:
58-
go-version: "1.23.7"
59-
60-
- name: Generate
61-
run: |
62-
go generate ./...
58+
go-version: "1.24.2"
6359

6460
- name: Build Test
6561
if: github.event_name != 'push' || !contains(github.ref, 'refs/tags/')

.github/workflows/test.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-go@v5
2727
with:
28-
go-version: "1.23.7"
29-
30-
- name: Generate
31-
run: |
32-
go generate ./...
28+
go-version: "1.24.2"
3329

3430
- name: Unit test
3531
run: |

cmd/agent/main.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"fmt"
1111
"io"
1212
"log"
13-
"maps"
1413
"math/rand"
1514
"net"
1615
"net/http"
@@ -784,7 +783,7 @@ func handleApplyConfigTask(task *pb.Task) {
784783
println("Executing Apply Config Task")
785784

786785
var tmpConfigRaw map[string]any
787-
var tmpConfig model.AgentConfig
786+
tmpConfig := agentConfig
788787
if err := json.Unmarshal([]byte(task.GetData()), &tmpConfigRaw); err != nil {
789788
printf("Parsing Config failed: %v", err)
790789
reloadStatus.Store(false)
@@ -813,7 +812,7 @@ func handleApplyConfigTask(task *pb.Task) {
813812
println("Will reload workers in 10 seconds")
814813
time.AfterFunc(10*time.Second, func() {
815814
println("Applying new configuration...")
816-
agentConfig.Apply(maps.Keys(tmpConfigRaw), &tmpConfig)
815+
agentConfig := tmpConfig
817816
agentConfig.Save()
818817
geoipReported = false
819818
logger.SetEnable(agentConfig.Debug)

model/gen/gen.go

-262
This file was deleted.

0 commit comments

Comments
 (0)