mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 11:27:42 +08:00
34 lines
567 B
Go
34 lines
567 B
Go
package util
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var Debug bool
|
|
var NotImplementedError = fmt.Errorf("Error: not implemented yet.")
|
|
|
|
// a Key for maps. It's a string (rep of a multihash).
|
|
type Key string
|
|
|
|
// Shorthand printing functions.
|
|
func PErr(format string, a ...interface{}) {
|
|
fmt.Fprintf(os.Stderr, format, a...)
|
|
}
|
|
|
|
func POut(format string, a ...interface{}) {
|
|
fmt.Fprintf(os.Stdout, format, a...)
|
|
}
|
|
|
|
func DErr(format string, a ...interface{}) {
|
|
if Debug {
|
|
PErr(format, a...)
|
|
}
|
|
}
|
|
|
|
func DOut(format string, a ...interface{}) {
|
|
if Debug {
|
|
POut(format, a...)
|
|
}
|
|
}
|