Skip to content

Commit 34f6f31

Browse files
DanielePalaiaDaniele Palaia
andauthored
changing defaultVersion to buildVersion and create a simple change_version file to manage versioning (#54)
Co-authored-by: Daniele Palaia <dpalaia@dpalaia-a02.vmware.com>
1 parent f31ee42 commit 34f6f31

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

change_version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#/bin/bash
2+
echo $1 > VERSION
3+
sed -i -e "s/.*buildVersion = \"*.*/buildVersion = \"$1\"/" ./connection.go
4+
go fmt ./...

client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func TestDefaultClientProperties(t *testing.T) {
229229
t.Errorf("expected product %s got: %s", want, got)
230230
}
231231

232-
if want, got := defaultVersion, srv.start.ClientProperties["version"]; want != got {
232+
if want, got := buildVersion, srv.start.ClientProperties["version"]; want != got {
233233
t.Errorf("expected version %s got: %s", want, got)
234234
}
235235

connection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
defaultHeartbeat = 10 * time.Second
2525
defaultConnectionTimeout = 30 * time.Second
2626
defaultProduct = "Amqp 0.9.1 Client"
27-
defaultVersion = "β"
27+
buildVersion = "1.3.0"
2828
platform = "golang"
2929
// Safer default that makes channel leaks a lot easier to spot
3030
// before they create operational headaches. See https://github.com/rabbitmq/rabbitmq-server/issues/1593.
@@ -759,7 +759,7 @@ func (c *Connection) openTune(config Config, auth Authentication) error {
759759
if len(config.Properties) == 0 {
760760
config.Properties = Table{
761761
"product": defaultProduct,
762-
"version": defaultVersion,
762+
"version": buildVersion,
763763
"platform": platform,
764764
}
765765
}

0 commit comments

Comments
 (0)