Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source pure

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be pu...

Readme View source

v0 - Unaudited This is an initial version of this package that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

fqname

Package fqname provides utilities for handling fully qualified identifiers in Gno, typically a package path followed by a dot and a symbol name.

Overview

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

Package fqname provides utilities for handling fully qualified identifiers in Gno, typically a package path followed by a dot and a symbol name.

Package fqname provides utilities for handling fully qualified identifiers in Gno. A fully qualified identifier typically includes a package path followed by a dot (.) and then the name of a variable, function, type, or other package-level declaration.

Functions 3

func Construct

1func Construct(pkgpath, name string) string
source

Construct a qualified identifier.

Example
1fqName := fqname.Construct("gno.land/r/demo/foo20", "Token")
2fmt.Println("Fully Qualified Name:", fqName)
3// Output: gno.land/r/demo/foo20.Token

func Parse

1func Parse(fqname string) (pkgpath, name string)
source

Parse splits a fully qualified identifier into its package path and name components. It handles cases with and without slashes in the package path.

Example
1pkgpath, name := fqname.Parse("gno.land/p/nt/avl/v0.Tree")
2ufmt.Sprintf("Package: %s, Name: %s\n", id.Package, id.Name)
3// Output: Package: gno.land/p/nt/avl/v0, Name: Tree

Imports 1

  • strings stdlib

Source Files 5