From 497dbecb6abe8a88b2fb31d65caea4a5f88611e9 Mon Sep 17 00:00:00 2001 From: pharr117 Date: Tue, 23 Jul 2024 15:15:55 -0400 Subject: [PATCH] Trim CosmWasm /v2 suffix from package string pulled from go mod --- builder/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/builder.go b/builder/builder.go index c6b66e9e..7f56d845 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -242,7 +242,7 @@ func getWasmvmVersion(modFile *modfile.File) string { for _, item := range modFile.Require { // Must have 2 tokens, repo & version if (len(item.Syntax.Token) == 2) && (strings.Contains(item.Syntax.Token[0], wasmvmRepo)) { - wasmvmRepo = item.Syntax.Token[0] + wasmvmRepo = strings.TrimSuffix(item.Syntax.Token[0], "/v2") wasmvmVersion = item.Syntax.Token[1] } } @@ -251,7 +251,7 @@ func getWasmvmVersion(modFile *modfile.File) string { for _, item := range modFile.Replace { // Must have 3 or more tokens if (len(item.Syntax.Token) > 2) && (strings.Contains(item.Syntax.Token[0], wasmvmRepo)) { - wasmvmRepo = item.Syntax.Token[len(item.Syntax.Token)-2] + wasmvmRepo = strings.TrimSuffix(item.Syntax.Token[len(item.Syntax.Token)-2], "/v2") wasmvmVersion = item.Syntax.Token[len(item.Syntax.Token)-1] } }