Commit c490bb6f authored by Rob Pike's avatar Rob Pike

gob: clarify the comments about installing the debug/dumper.

R=rsc
CC=golang-dev
https://golang.org/cl/2789043
parent 96b9efe8
package gob package gob
// This file is not normally included in the gob package. Used only for debugging the package itself. // This file is not normally included in the gob package. Used only for debugging the package itself.
// Add debug.go to the files listed in the Makefile to add Debug to the gob package.
import ( import (
"bytes" "bytes"
...@@ -14,7 +15,7 @@ import ( ...@@ -14,7 +15,7 @@ import (
var dump = false // If true, print the remaining bytes in the input buffer at each item. var dump = false // If true, print the remaining bytes in the input buffer at each item.
// Init installs the debugging facility. If this file is not compiled in the // Init installs the debugging facility. If this file is not compiled in the
// package, Debug will be a no-op. // package, the test in codec_test.go is a no-op.
func init() { func init() {
debugFunc = Debug debugFunc = Debug
} }
......
...@@ -153,6 +153,7 @@ func (dec *Decoder) DecodeValue(value reflect.Value) os.Error { ...@@ -153,6 +153,7 @@ func (dec *Decoder) DecodeValue(value reflect.Value) os.Error {
return dec.err return dec.err
} }
// If enabled, Debug prints a human-readable representation of the gob data read from r. // If debug.go is compiled into the program , debugFunc prints a human-readable
// If debug.go is compiled into the program it will override this link. // representation of the gob data read from r by calling that file's Debug function.
// Otherwise it is nil.
var debugFunc func(io.Reader) var debugFunc func(io.Reader)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment