Golang packages: Difference between revisions

From wikinotes
(Created page with "= Imports = <blockquote> <syntaxhighlight lang="go"> import ( "fmt" "golang.org/x/example/stringutil" ) </syntaxhighlight> </blockquote><!-- Imports -->")
 
Line 3: Line 3:
<syntaxhighlight lang="go">
<syntaxhighlight lang="go">
import (
import (
     "fmt"
     "fmt"                               // builtin pkgs have no module-path prefix
     "golang.org/x/example/stringutil"
     "golang.org/x/example/stringutil"   // third-party pkgs have module-path prefix
)
)
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Imports -->
</blockquote><!-- Imports -->

Revision as of 19:29, 23 May 2022

Imports

import (
    "fmt"                                // builtin pkgs have no module-path prefix
    "golang.org/x/example/stringutil"    // third-party pkgs have module-path prefix
)