Skip to content

Commit

Permalink
Trim CosmWasm /v2 suffix from package string pulled from go mod
Browse files Browse the repository at this point in the history
  • Loading branch information
minniux committed Aug 21, 2024
1 parent d350421 commit ca05b40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand All @@ -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]
}
}
Expand Down

0 comments on commit ca05b40

Please sign in to comment.