Skip to content

Commit

Permalink
lang: Small build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
purpleidea committed Sep 12, 2022
1 parent b87fa67 commit 2319f4f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 12 deletions.
10 changes: 5 additions & 5 deletions lang/funcs/core/iter/map_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const (
// MapFunc is the standard map iterator function that applies a function to each
// element in a list. It returns a list with the same number of elements as the
// input list. There is no requirement that the element output type be the same
// as the input element type. This implements the signature:
// `func(inputs []T1, function func(T1) T2) []T2` instead of the alternate with
// the two input args swapped, because while the latter is more common with
// languages that support partial function application, the former variant that
// we implemented is much more readable when using an inline lambda.
// as the input element type. This implements the signature: `func(inputs []T1,
// function func(T1) T2) []T2` instead of the alternate with the two input args
// swapped, because while the latter is more common with languages that support
// partial function application, the former variant that we implemented is much
// more readable when using an inline lambda.
// TODO: should we extend this to support iterating over map's and structs, or
// should that be a different function? I think a different function is best.
type MapFunc struct {
Expand Down
2 changes: 1 addition & 1 deletion lang/gapi/gapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ func (obj *GAPI) Get(getInfo *gapi.GetInfo) error {
// don't think we need to pass in an initial scope because the download
// operation shouldn't depend on any initial scope values, since those
// would all be runtime changes, and we do not support dynamic imports!
// XXX Add non-empty scope?
// XXX: Add non-empty scope?
if err := iast.SetScope(nil); err != nil { // empty initial scope!
return errwrap.Wrapf(err, "could not set scope")
}
Expand Down
12 changes: 12 additions & 0 deletions lang/interpret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ func TestAstFunc1(t *testing.T) {
graphFileFull := dir + graphFile
info, err := os.Stat(graphFileFull)
if err != nil || info.IsDir() {
p := dir + f + ".T" + "O" + "+D" + "O"
if _, err := os.Stat(p); err == nil {
// if it's a WIP, then don't error things
t.Logf("missing: %s", p)
continue
}
t.Errorf("missing: %s", graphFile)
t.Errorf("(err: %+v)", err)
continue
Expand Down Expand Up @@ -1091,6 +1097,12 @@ func TestAstFunc2(t *testing.T) {
graphFileFull := dir + graphFile
info, err := os.Stat(graphFileFull)
if err != nil || info.IsDir() {
p := dir + f + ".T" + "O" + "+D" + "O"
if _, err := os.Stat(p); err == nil {
// if it's a WIP, then don't error things
t.Logf("missing: %s", p)
continue
}
t.Errorf("missing: %s", graphFile)
t.Errorf("(err: %+v)", err)
continue
Expand Down
12 changes: 6 additions & 6 deletions misc/make-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ fi
[ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X

fold_start "Install golang tools"
go install github.com/blynn/nex # for lexing
go install golang.org/x/tools/cmd/goyacc # formerly `go tool yacc`
go install golang.org/x/tools/cmd/stringer # for automatic stringer-ing
go install golang.org/x/lint/golint # for `golint`-ing
go install golang.org/x/tools/cmd/goimports # for fmt
go install github.com/dvyukov/go-fuzz/go-fuzz # for fuzzing the mcl lang bits
cd / && go install github.com/blynn/nex@latest # for lexing
cd / && go install golang.org/x/tools/cmd/goyacc@latest # formerly `go tool yacc`
cd / && go install golang.org/x/tools/cmd/stringer@latest # for automatic stringer-ing
cd / && go install golang.org/x/lint/golint@latest # for `golint`-ing
cd / && go install golang.org/x/tools/cmd/goimports@latest # for fmt
cd / && go install github.com/dvyukov/go-fuzz/go-fuzz@latest # for fuzzing the mcl lang bits
if in_ci; then
go get -u gopkg.in/alecthomas/gometalinter.v1 && \
mv "$(dirname $(command -v gometalinter.v1))/gometalinter.v1" "$(dirname $(command -v gometalinter.v1))/gometalinter" && \
Expand Down

0 comments on commit 2319f4f

Please sign in to comment.