openlang

Where can I find fmt and the main package?

Lots of go examples begin with :

package main
import "fmt"

The GOPATH I use:

echo $GOPATH
/home/fernuser/go

Where are main and the fmt module stored?

The conversation continues 2

Follow the reasoning
  1. Permalink

    For the fmt module, look in /usr/local/go/src/fmt/.

    Writing package main identifies this file as belonging to an executable program. For library code, that declaration would instead read package <name of the library>

Other sides of the same question

  1. Formatting list elements as text with functional programming

    I'm a functional programming beginner, trying to create a function which accepts values in a list (whose length isn't fixed)…

    Replies 2Latest activity gleam
  2. Lean4 reports that 'begin' is unknown

    In the VSCode editor, I entered this Lean4 code: and got "unknown identifier 'begin'". Adding end three lines below gives "in…

    Replies 2Latest activity lean-4
  3. A JavaScript class to take?

    The last year I consulted JavaScript documentation was 1996. I'd like an educational course covering the “essential JavaScrip…

    Replies 2Latest activity elmjavascript