aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/encoding/gob/dump.go
blob: 0d0017cc783c6224b4b2e904c33e534bdc60862e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main

// Need to compile package gob with debug.go to build this program.

import (
	"encoding/gob"
	"fmt"
	"os"
)

func main() {
	var err error
	file := os.Stdin
	if len(os.Args) > 1 {
		file, err = os.Open(os.Args[1])
		if err != nil {
			fmt.Fprintf(os.Stderr, "dump: %s\n", err)
			os.Exit(1)
		}
	}
	gob.Debug(file)
}