Skip to content

Commit

Permalink
internal: remove package-level init with fastlyABIInit()
Browse files Browse the repository at this point in the history
We were ignoring the return value anyway and it complicates wizer integration.
  • Loading branch information
dgryski committed Apr 15, 2023
1 parent e600cde commit 797c52d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 3 additions & 8 deletions internal/abi/fastly/hostcalls_guest.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import (
"github.com/fastly/compute-sdk-go/internal/abi/prim"
)

func init() {
fastlyABIInit(1)
}

// witx:
//
// (module $fastly_abi
Expand All @@ -32,11 +28,10 @@ func init() {
//go:noescape
func fastlyABIInit(abiVersion prim.U64) FastlyStatus

// TODO(pb): this doesn't need to be exported, I don't think?
// Initialize the Fastly ABI at the given version.
//func Initialize(version uint64) error {
// return fastlyABIInit(version).toError()
//}
func Initialize(version uint64) error {
return fastlyABIInit(version).toError()
}

// witx:
//
Expand Down
4 changes: 4 additions & 0 deletions internal/abi/fastly/hostcalls_noguest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
"net"
)

func Initialize(version uint64) error {
return fmt.Errorf("not implemented")
}

func ParseUserAgent(userAgent string) (family, major, minor, patch string, err error) {
return "", "", "", "", fmt.Errorf("not implemented")
}
Expand Down

0 comments on commit 797c52d

Please sign in to comment.