package main import ( "bufio" "fmt" "os" ) func main() { file, err := os.Open("file.txt") if err != nil { panic(err) } defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { fmt.Println(scanner.Text()) } if scanner.Err() != nil { panic(scanner.Err()) } }In this example, we read the contents of a file named "file.txt" using the `os.Open` function to retrieve the file handle. We then create a `bufio.Scanner` to read the contents of the file line-by-line. The `for` loop reads each line of the file and prints it to the console. The package library for this example is the standard `os` package that is included with Go.