Packages supported by TinyGo

The following table shows all Go standard library packages and whether they can be imported by TinyGo. If they can’t, you can click the ‘no’ link to jump to the explanation why the package cannot be compiled.

Note that the fact they can be imported, does not mean that all functions and types in the program can be used. For example, sometimes using some functions or types of the package will still trigger compiler errors.

Package Importable
archive/tar yes
archive/zip yes
bufio yes
bytes yes
compress/bzip2 yes
compress/flate yes
compress/gzip yes
compress/lzw yes
compress/zlib yes
container/heap yes
container/list yes
container/ring yes
context yes
crypto yes
crypto/aes yes
crypto/cipher yes
crypto/des yes
crypto/dsa yes
crypto/ecdsa yes
crypto/ed25519 yes
crypto/elliptic yes
crypto/hmac yes
crypto/md5 yes
crypto/rand yes
crypto/rc4 yes
crypto/rsa yes
crypto/sha1 yes
crypto/sha256 yes
crypto/sha512 yes
crypto/subtle yes
crypto/tls yes
crypto/x509 yes
crypto/x509/pkix yes
database/sql yes
database/sql/driver yes
debug/dwarf yes
debug/elf yes
debug/gosym yes
debug/macho yes
debug/pe yes
debug/plan9obj yes
embed yes
encoding yes
encoding/ascii85 yes
encoding/asn1 yes
encoding/base32 yes
encoding/base64 yes
encoding/binary yes
encoding/csv yes
encoding/gob no
encoding/hex yes
encoding/json yes
encoding/pem yes
encoding/xml no
errors yes
expvar no
flag yes
fmt yes
go/ast yes
go/build no
go/build/constraint yes
go/constant yes
go/doc no
go/format yes
go/importer no
go/parser yes
go/printer yes
go/scanner yes
go/token yes
go/types yes
hash yes
hash/adler32 yes
hash/crc32 yes
hash/crc64 yes
hash/fnv yes
hash/maphash yes
html yes
html/template no
image yes
image/color yes
image/color/palette yes
image/draw yes
image/gif yes
image/jpeg yes
image/png yes
index/suffixarray yes
io yes
io/fs yes
io/ioutil yes
log yes
log/syslog yes
math yes
math/big yes
math/bits yes
math/cmplx yes
math/rand yes
mime yes
mime/multipart yes
mime/quotedprintable yes
net yes
net/http no
net/http/cgi no
net/http/cookiejar no
net/http/fcgi no
net/http/httptest no
net/http/httptrace yes
net/http/httputil no
net/http/pprof no
net/mail yes
net/rpc no
net/rpc/jsonrpc no
net/smtp yes
net/textproto yes
net/url yes
os yes
os/exec no
os/signal yes
os/user no
path yes
path/filepath yes
plugin yes
reflect yes
regexp yes
regexp/syntax yes
sort yes
strconv yes
strings yes
sync yes
sync/atomic yes
syscall yes
syscall/js yes
testing yes
testing/fstest yes
testing/iotest yes
testing/quick no
text/scanner yes
text/tabwriter yes
text/template no
text/template/parse yes
time yes
time/tzdata yes
unicode yes
unicode/utf16 yes
unicode/utf8 yes
unsafe yes

encoding/gob

The compiler gave the following error when this package was imported:

# encoding/gob
/home/ron/.gvm/gos/go1.16.3/src/encoding/gob/decode.go:562:21: MakeMapWithSize not declared by package reflect
/home/ron/.gvm/gos/go1.16.3/src/encoding/gob/decode.go:1118:30: srt.FieldByName undefined (type reflect.Type has no field or method FieldByName)
/home/ron/.gvm/gos/go1.16.3/src/encoding/gob/encode.go:643:70: f.Index undefined (type reflect.StructField has no field or method Index)
/home/ron/.gvm/gos/go1.16.3/src/encoding/gob/type.go:867:9: rt.PkgPath undefined (type reflect.Type has no field or method PkgPath)
/home/ron/.gvm/gos/go1.16.3/src/encoding/gob/type.go:870:21: rt.PkgPath undefined (type reflect.Type has no field or method PkgPath)

encoding/xml

The compiler gave the following error when this package was imported:

# encoding/xml
/home/ron/.gvm/gos/go1.16.3/src/encoding/xml/typeinfo.go:114:29: f.Index undefined (type *reflect.StructField has no field or method Index)
/home/ron/.gvm/gos/go1.16.3/src/encoding/xml/typeinfo.go:318:14: typ.FieldByIndex undefined (type reflect.Type has no field or method FieldByIndex)
/home/ron/.gvm/gos/go1.16.3/src/encoding/xml/typeinfo.go:319:14: typ.FieldByIndex undefined (type reflect.Type has no field or method FieldByIndex)

expvar

This package cannot be imported because the following dependencies cannot be compiled:

go/build

This package cannot be imported because the following dependencies cannot be compiled:

go/doc

This package cannot be imported because the following dependencies cannot be compiled:

go/importer

This package cannot be imported because the following dependencies cannot be compiled:

html/template

This package cannot be imported because the following dependencies cannot be compiled:

net/http

The compiler gave the following error when this package was imported:

/home/ron/.gvm/gos/go1.16.3/src/net/http/transport.go:1587:5: todo: go on interface call

net/http/cgi

This package cannot be imported because the following dependencies cannot be compiled:

net/http/cookiejar

This package cannot be imported because the following dependencies cannot be compiled:

net/http/fcgi

This package cannot be imported because the following dependencies cannot be compiled:

net/http/httptest

This package cannot be imported because the following dependencies cannot be compiled:

net/http/httputil

This package cannot be imported because the following dependencies cannot be compiled:

net/http/pprof

This package cannot be imported because the following dependencies cannot be compiled:

net/rpc

This package cannot be imported because the following dependencies cannot be compiled:

net/rpc/jsonrpc

This package cannot be imported because the following dependencies cannot be compiled:

os/exec

The compiler gave the following error when this package was imported:

# os/exec
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:130:14: Process not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:134:19: ProcessState not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:462:6: ProcessState not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:246:23: DevNull not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:258:20: Pipe not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:291:27: DevNull not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:303:20: Pipe not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:422:22: StartProcess not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:422:57: ProcAttr not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:584:20: Pipe not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:626:20: Pipe not declared by package os
/home/ron/.gvm/gos/go1.16.3/src/os/exec/exec.go:651:20: Pipe not declared by package os

os/user

The compiler gave the following error when this package was imported:

# os/user
/home/ron/.gvm/gos/go1.16.3/src/os/user/lookup.go:15:41: undeclared name: current
/home/ron/.gvm/gos/go1.16.3/src/os/user/lookup.go:36:9: undeclared name: lookupUser
/home/ron/.gvm/gos/go1.16.3/src/os/user/lookup.go:45:9: undeclared name: lookupUserId
/home/ron/.gvm/gos/go1.16.3/src/os/user/lookup.go:51:9: undeclared name: lookupGroup
/home/ron/.gvm/gos/go1.16.3/src/os/user/lookup.go:57:9: undeclared name: lookupGroupId
/home/ron/.gvm/gos/go1.16.3/src/os/user/lookup.go:62:9: undeclared name: listGroups

testing/quick

The compiler gave the following error when this package was imported:

# testing/quick
/home/ron/.gvm/gos/go1.16.3/src/testing/quick/quick.go:273:11: fType.NumOut undefined (type reflect.Type has no field or method NumOut)
/home/ron/.gvm/gos/go1.16.3/src/testing/quick/quick.go:276:11: fType.Out undefined (type reflect.Type has no field or method Out)
/home/ron/.gvm/gos/go1.16.3/src/testing/quick/quick.go:280:43: fType.NumIn undefined (type reflect.Type has no field or method NumIn)
/home/ron/.gvm/gos/go1.16.3/src/testing/quick/quick.go:320:43: xType.NumIn undefined (type reflect.Type has no field or method NumIn)
/home/ron/.gvm/gos/go1.16.3/src/testing/quick/quick.go:351:25: f.In undefined (type reflect.Type has no field or method In)
/home/ron/.gvm/gos/go1.16.3/src/testing/quick/quick.go:353:95: f.In undefined (type reflect.Type has no field or method In)

text/template

The compiler gave the following error when this package was imported:

# text/template
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:376:17: val.Type().ChanDir undefined (type reflect.Type has no field or method ChanDir)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:376:38: SendDir not declared by package reflect
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:382:20: val.Recv undefined (type reflect.Value has no field or method Recv)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:608:19: ptr.MethodByName undefined (type reflect.Value has no field or method MethodByName)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:615:33: receiver.Type().FieldByName undefined (type reflect.Type has no field or method FieldByName)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:650:21: etyp.FieldByName undefined (type reflect.Type has no field or method FieldByName)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:683:9: typ.IsVariadic undefined (type reflect.Type has no field or method IsVariadic)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:684:18: typ.NumIn undefined (type reflect.Type has no field or method NumIn)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:686:79: typ.NumIn undefined (type reflect.Type has no field or method NumIn)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:688:25: typ.NumIn undefined (type reflect.Type has no field or method NumIn)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:689:69: typ.NumIn undefined (type reflect.Type has no field or method NumIn)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:693:71: typ.NumOut undefined (type reflect.Type has no field or method NumOut)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:700:32: typ.In undefined (type reflect.Type has no field or method In)
/home/ron/.gvm/gos/go1.16.3/src/text/template/exec.go:703:9: typ.IsVariadic undefined (type reflect.Type has no field or method IsVariadic)
[...more lines following...]