MCPcopy Create free account
hub / github.com/goinaction/code / main

Function main

chapter8/listing37/listing37.go:12–25  ·  view source on GitHub ↗

main is the entry point for the application.

()

Source from the content-addressed store, hash-verified

10
11// main is the entry point for the application.
12func main() {
13 // Create a Buffer value and write a string to the buffer.
14 // Using the Write method that implements io.Writer.
15 var b bytes.Buffer
16 b.Write([]byte("Hello "))
17
18 // Use Fprintf to concatenate a string to the Buffer.
19 // Passing the address of a bytes.Buffer value for io.Writer.
20 fmt.Fprintf(&b, "World!")
21
22 // Write the content of the Buffer to the stdout device.
23 // Passing the address of a os.File value for io.Writer.
24 b.WriteTo(os.Stdout)
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected