Go Printing to Stdout and Stderr: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 11: Line 11:
<syntaxhighlight lang='go'>
<syntaxhighlight lang='go'>
import "fmt"
import "fmt"
func main() {
 
  fmt.Printf("something")
// ...
}
fmt.Printf("something")
</syntaxhighlight>
 
==Format Strings==
<syntaxhighlight lang='go'>
fmt.Printf("Hello %s", "Bob")
</syntaxhighlight>
</syntaxhighlight>

Revision as of 23:21, 18 August 2023

Internal

println()

func main() {
  println("something")
}

fmt.Printf()

import "fmt"

// ...
fmt.Printf("something")

Format Strings

fmt.Printf("Hello %s", "Bob")