Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined: net.LookupHost #4722

Open
NMFR opened this issue Jan 31, 2025 · 0 comments
Open

undefined: net.LookupHost #4722

NMFR opened this issue Jan 31, 2025 · 0 comments
Labels
network Anything to do with network use from TinyGo wasm WebAssembly

Comments

@NMFR
Copy link

NMFR commented Jan 31, 2025

Hi,

I am getting a undefined: net.LookupHost error when trying to compile to WebAssembly using tinygo.
A dependency I have (sprig) uses net.LookupHost.
I don't intend to call the function that uses that, I am looking to just get it to compile.

Replication:

main.go:

package main

import (
	"fmt"

	"github.com/Masterminds/sprig/v3"
)

func main() {
	funcMap := sprig.FuncMap()

	delete(funcMap, "getHostByName")

	lower := funcMap["lower"].(func(string) string)

	fmt.Println(lower("HELLO WORLD"))
}
tinygo version
tinygo version 0.35.0 linux/amd64 (using go version go1.21.4 and LLVM version 18.1.2)

GOOS=wasip1 GOARCH=wasm tinygo build -o main.wasm main.go
# github.com/Masterminds/sprig/v3
../../go/pkg/mod/github.com/!masterminds/sprig/[email protected]/network.go:9:18: undefined: net.LookupHost

Thanks in advance.

@deadprogram deadprogram added wasm WebAssembly network Anything to do with network use from TinyGo labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network Anything to do with network use from TinyGo wasm WebAssembly
Projects
None yet
Development

No branches or pull requests

2 participants