Skip to content

Commit

Permalink
Fix valueType using valueRefl instead of TypeOf.
Browse files Browse the repository at this point in the history
Also add Makefile to help build binaries for infracopilot
  • Loading branch information
gordon-klotho committed Sep 26, 2023
1 parent c3788ac commit a672c38
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ keyvalue.js.tmpl

node_modules/
/*.yaml

# binaries
/engine
/iac
/klotho
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GO_FILES := $(wildcard pkg/**/*.go) go.sum go.mod

engine: $(GO_FILES)
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64 \
CC="zig cc -target x86_64-linux-musl" \
CXX="zig c++ -target x86_64-linux-musl" \
go build --tags extended -o engine -ldflags="-s -w" ./cmd/engine

iac: $(GO_FILES)
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64 \
CC="zig cc -target x86_64-linux-musl" \
CXX="zig c++ -target x86_64-linux-musl" \
go build --tags extended -o iac -ldflags="-s -w" ./cmd/iac
2 changes: 1 addition & 1 deletion pkg/engine/resource_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func ConfigureField(resource construct.Resource, fieldName string, value interfa
setMapKey.Value = field
}
valueRefl := reflect.ValueOf(value)
valueType := valueRefl.Type()
valueType := reflect.TypeOf(value)
switch field.Kind() {
case reflect.Slice, reflect.Array:
if valueRefl.Kind() != reflect.Slice {
Expand Down

0 comments on commit a672c38

Please sign in to comment.