Files
wazero/internal/wasip1/wasi.go
Crypt Keeper b600ed98a2 renames internal wasi package to wasip1 and removes dot imports (#1273)
This removes the generally frowned upon practice of dot imports by
shortening the name of internal/wasi_snapshot_preview1 to
internal/wasip1. This leaves the external one alone as it would break
users to change it.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-03-23 08:08:27 +09:00

28 lines
565 B
Go

// Package wasi_snapshot_preview1 is a helper to remove package cycles re-using
// constants.
package wasip1
import (
"strings"
)
// InternalModuleName is not named ModuleName, to avoid a clash on dot imports.
const InternalModuleName = "wasi_snapshot_preview1"
func flagsString(names []string, f int) string {
var builder strings.Builder
first := true
for i, sf := range names {
target := 1 << i
if target&f != 0 {
if !first {
builder.WriteByte('|')
} else {
first = false
}
builder.WriteString(sf)
}
}
return builder.String()
}