mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
util
This commit is contained in:
parent
381bfaa691
commit
69e92f939c
30
util/util.go
Normal file
30
util/util.go
Normal file
@ -0,0 +1,30 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
var Debug bool
|
||||
var NotImplementedError = fmt.Errorf("Error: not implemented yet.")
|
||||
|
||||
// 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...)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user