Skip to content

Commit

Permalink
Go SDK: stop pointerizing input types to undo breaking change (#5865)
Browse files Browse the repository at this point in the history
* stop pointerizing input types

this was needed to avoid dependency cycles in self-referential input
types, but we don't have those anymore, in favor of just always using
objects and passing them in by their ID.

Signed-off-by: Alex Suraci <[email protected]>

* bump go sdk runtime, regen runtime sdk

Signed-off-by: Alex Suraci <[email protected]>

* regen vito-mod example

Signed-off-by: Alex Suraci <[email protected]>

---------

Signed-off-by: Alex Suraci <[email protected]>
  • Loading branch information
vito authored Oct 11, 2023
1 parent 3bf8d53 commit 8dfa23f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
6 changes: 0 additions & 6 deletions codegen/generator/go/templates/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,11 @@ func (f *FormatTypeFunc) FormatKindScalarDefault(representation string, refName
}

func (f *FormatTypeFunc) FormatKindObject(representation string, refName string, input bool) string {
if input {
representation += "*"
}
representation += formatName(refName)
return representation
}

func (f *FormatTypeFunc) FormatKindInputObject(representation string, refName string, input bool) string {
if input {
representation += "*"
}
representation += formatName(refName)
return representation
}
Expand Down
14 changes: 7 additions & 7 deletions dagger.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/sdks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ package modules
// building a Dockerfile. We would still want some sort of shorthand though. No
// one wants to type dagger mod init --sdk=github.com/dagger/dagger-sdk-go.
var WellKnownSDKRuntimes = map[string]string{
"go": "vito/dagger-sdk-go:no-vcs-flag@sha256:0fcc9d2659cdd551acb7aaf25e77215e9687475eb89ec06cae989eaf332ee480",
"go": "vito/dagger-sdk-go:no-ptrs@sha256:2bb26bae3f30b920a4530b7495127fe4986102b06a99ff170500e83c25739b27",
}
16 changes: 9 additions & 7 deletions runtime/dagger.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/dagger.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "go-sdk",
"sdk": "go",
"sdkRuntime": "vito/dagger-sdk-go:no-vcs-flag@sha256:0fcc9d2659cdd551acb7aaf25e77215e9687475eb89ec06cae989eaf332ee480",
"sdkRuntime": "vito/dagger-sdk-go:no-ptrs@sha256:2bb26bae3f30b920a4530b7495127fe4986102b06a99ff170500e83c25739b27",
"root": ".."
}

0 comments on commit 8dfa23f

Please sign in to comment.