Skip to content

Commit 7809aef

Browse files
committed
Released binaries will default to the test server
1 parent 7e6f5e4 commit 7809aef

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ builds:
22
- id: "client"
33
dir: cmd/client
44
binary: client
5+
ldflags:
6+
- -X main.defaultAddr=104.196.192.37:9000
57
- id: "server"
68
dir: cmd/server
79
binary: server

Dockerfile.client

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN go mod download
77

88
COPY . ./
99

10-
RUN go build -o client -v ./cmd/client
10+
RUN go build -o client -v -ldflag "-X main.defaultAddr=104.196.192.37:9000" ./cmd/client
1111

1212
FROM debian:buster-slim
1313
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \

cmd/client/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
)
1313

1414
var (
15-
addr = flag.String("addr", "localhost:9000", "Server address")
16-
name = flag.String("name", "", "Your name")
15+
defaultAddr = "localhost:9000"
16+
addr = flag.String("addr", defaultAddr, "Server address")
17+
name = flag.String("name", "", "Your name")
1718
)
1819

1920
func main() {

0 commit comments

Comments
 (0)