-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Apple Silicon (for
solc >= 0.8.24
) (#40)
* internal/version: init * added support for darwin-arm64 * updated setup-go * updated go version * examples: updated go version --------- Co-authored-by: lmittmann <[email protected]>
- Loading branch information
Showing
7 changed files
with
106 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module examples | ||
|
||
go 1.21 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/lmittmann/go-solc v0.0.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/lmittmann/go-solc | ||
|
||
go 1.21 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/ethereum/go-ethereum v1.13.14 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package version | ||
|
||
import "go/version" | ||
|
||
func IsValid(x string) bool { | ||
return version.IsValid("go" + x) | ||
} | ||
|
||
func Compare(x, y string) int { | ||
return version.Compare("go"+x, "go"+y) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package version_test | ||
|
||
import ( | ||
"strconv" | ||
"testing" | ||
|
||
"github.com/lmittmann/go-solc/internal/version" | ||
) | ||
|
||
func TestIsValid(t *testing.T) { | ||
tests := []struct { | ||
VersionStr string | ||
Want bool | ||
}{ | ||
{"0.1.2", true}, | ||
{"go0.1.2", false}, | ||
} | ||
|
||
for i, test := range tests { | ||
t.Run(strconv.Itoa(i), func(t *testing.T) { | ||
got := version.IsValid(test.VersionStr) | ||
if test.Want != got { | ||
t.Fatalf("want %t, got %t", test.Want, got) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
func TestCompare(t *testing.T) { | ||
tests := []struct { | ||
X, Y string | ||
Want int | ||
}{ | ||
{"0.5", "0.5", 0}, | ||
{"0.1", "0.5", -1}, | ||
{"0.5", "0.1", 1}, | ||
} | ||
|
||
for i, test := range tests { | ||
t.Run(strconv.Itoa(i), func(t *testing.T) { | ||
got := version.Compare(test.X, test.Y) | ||
if test.Want != got { | ||
t.Fatalf("want %d, got %d", test.Want, got) | ||
} | ||
}) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters