blob: 17238c98df0d3bdf04a1084c1edd129a656f8e84 [file] [log] [blame]
Olivier Duperraye5c1f382012-01-19 10:14:56 -08001// Copyright 2009 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
Russ Cox9f333172012-02-14 16:39:20 -05005// +build ignore
6
Rob Pikee7601e22009-12-29 14:03:33 +11007package main
8
9// Need to compile package gob with debug.go to build this program.
Shenghou Mae0aa3612012-02-28 13:39:42 +080010// See comments in debug.go for how to do this.
Rob Pikee7601e22009-12-29 14:03:33 +110011
12import (
Rob Pike30aa7012011-11-08 15:40:58 -080013 "encoding/gob"
Rob Pikee7601e22009-12-29 14:03:33 +110014 "fmt"
Rob Pikee7601e22009-12-29 14:03:33 +110015 "os"
16)
17
18func main() {
Russ Coxc2049d22011-11-01 22:04:37 -040019 var err error
Rob Pikee7601e22009-12-29 14:03:33 +110020 file := os.Stdin
21 if len(os.Args) > 1 {
Rob Pike8a90fd32011-04-04 23:42:14 -070022 file, err = os.Open(os.Args[1])
Rob Pikee7601e22009-12-29 14:03:33 +110023 if err != nil {
24 fmt.Fprintf(os.Stderr, "dump: %s\n", err)
25 os.Exit(1)
26 }
27 }
28 gob.Debug(file)
29}