From 37c0dbcfe6d6fdc12d92f00ceb06c4baa367fcdf Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 31 Mar 2020 21:27:18 -0400 Subject: [PATCH] fix codegen for ugorji/go When generating ugorji/go package, we should use github.com/hashicorp/go-msgpack/codec instead. Also fix the reference for codegen_generated --- client/structs/generate.sh | 6 ++++++ client/structs/structs.go | 2 +- nomad/structs/generate.sh | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 client/structs/generate.sh diff --git a/client/structs/generate.sh b/client/structs/generate.sh new file mode 100755 index 000000000..ecc27946b --- /dev/null +++ b/client/structs/generate.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +codecgen -d 102 -t codegen_generated -o structs.generated.go structs.go +sed -i'' -e 's|"github.com/ugorji/go/codec|"github.com/hashicorp/go-msgpack/codec|g' structs.generated.go diff --git a/client/structs/structs.go b/client/structs/structs.go index a676e557a..c6598084c 100644 --- a/client/structs/structs.go +++ b/client/structs/structs.go @@ -1,6 +1,6 @@ package structs -//go:generate codecgen -d 102 -t codec_generated -o structs.generated.go structs.go +//go:generate ./generate.sh import ( "errors" diff --git a/nomad/structs/generate.sh b/nomad/structs/generate.sh index c0409e707..58739e7ee 100755 --- a/nomad/structs/generate.sh +++ b/nomad/structs/generate.sh @@ -2,4 +2,5 @@ set -e FILES="$(ls ./*.go | grep -v -e _test.go -e .generated.go | tr '\n' ' ')" -codecgen -d 100 -t codec_generated -o structs.generated.go ${FILES} +codecgen -d 100 -t codegen_generated -o structs.generated.go ${FILES} +sed -i'' -e 's|"github.com/ugorji/go/codec|"github.com/hashicorp/go-msgpack/codec|g' structs.generated.go