Skip to content

Commit e8d19a9

Browse files
committed
internal: remove package-level init with fastlyABIInit()
We were ignoring the return value anyway and it complicates wizer integration.
1 parent e600cde commit e8d19a9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

internal/abi/fastly/hostcalls_guest.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import (
1515
"github.com/fastly/compute-sdk-go/internal/abi/prim"
1616
)
1717

18-
func init() {
19-
fastlyABIInit(1)
20-
}
21-
2218
// witx:
2319
//
2420
// (module $fastly_abi
@@ -32,11 +28,10 @@ func init() {
3228
//go:noescape
3329
func fastlyABIInit(abiVersion prim.U64) FastlyStatus
3430

35-
// TODO(pb): this doesn't need to be exported, I don't think?
3631
// Initialize the Fastly ABI at the given version.
37-
//func Initialize(version uint64) error {
38-
// return fastlyABIInit(version).toError()
39-
//}
32+
func Initialize(version uint64) error {
33+
return fastlyABIInit(prim.U64(version)).toError()
34+
}
4035

4136
// witx:
4237
//

internal/abi/fastly/hostcalls_noguest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import (
1313
"net"
1414
)
1515

16+
func Initialize(version uint64) error {
17+
return fmt.Errorf("not implemented")
18+
}
19+
1620
func ParseUserAgent(userAgent string) (family, major, minor, patch string, err error) {
1721
return "", "", "", "", fmt.Errorf("not implemented")
1822
}

0 commit comments

Comments
 (0)