the good life

This commit is contained in:
Mark Bates 2019-08-30 13:56:41 -04:00
parent 298bc6dc59
commit 68f3a2a457
7 changed files with 0 additions and 31 deletions

View File

@ -3,8 +3,6 @@ package here
import ( import (
"path/filepath" "path/filepath"
"sync" "sync"
"github.com/markbates/pkger/internal/debug"
) )
var curOnce sync.Once var curOnce sync.Once
@ -13,7 +11,6 @@ var current Info
func Current() (Info, error) { func Current() (Info, error) {
(&curOnce).Do(func() { (&curOnce).Do(func() {
debug.Debug("[HERE] Current")
b, err := run("go", "env", "GOMOD") b, err := run("go", "env", "GOMOD")
if err != nil { if err != nil {
curErr = err curErr = err

View File

@ -4,15 +4,11 @@ import (
"bytes" "bytes"
"os" "os"
"os/exec" "os/exec"
"github.com/markbates/pkger/internal/debug"
) )
func run(n string, args ...string) ([]byte, error) { func run(n string, args ...string) ([]byte, error) {
c := exec.Command(n, args...) c := exec.Command(n, args...)
debug.Debug("[HERE] %s", c.Args)
bb := &bytes.Buffer{} bb := &bytes.Buffer{}
c.Stdout = bb c.Stdout = bb
c.Stderr = os.Stderr c.Stderr = os.Stderr

View File

@ -1,9 +0,0 @@
// +build debug
package debug
import "fmt"
func Debug(format string, a ...interface{}) {
fmt.Println("[PKGER]", fmt.Sprintf(format, a...))
}

View File

@ -1,5 +0,0 @@
// +build !debug
package debug
func Debug(format string, a ...interface{}) {}

View File

@ -42,7 +42,6 @@ func Open(name string) (*File, error) {
return nil, err return nil, err
} }
dubeg("Open", pt.String())
f, ok := filesCache.Load(pt) f, ok := filesCache.Load(pt)
if !ok { if !ok {
return openDisk(pt) return openDisk(pt)
@ -58,7 +57,6 @@ func Open(name string) (*File, error) {
} }
func openDisk(pt Path) (*File, error) { func openDisk(pt Path) (*File, error) {
dubeg("openDisk", pt.String())
info, err := Info(pt.Pkg) info, err := Info(pt.Pkg)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -14,7 +14,6 @@ type Path struct {
} }
func Parse(p string) (Path, error) { func Parse(p string) (Path, error) {
dubeg("Parse", p)
p = strings.Replace(p, "\\", "/", -1) p = strings.Replace(p, "\\", "/", -1)
pt, ok := pathsCache.Load(p) pt, ok := pathsCache.Load(p)
if ok { if ok {

View File

@ -12,7 +12,6 @@ import (
"sync" "sync"
"github.com/markbates/pkger/here" "github.com/markbates/pkger/here"
"github.com/markbates/pkger/internal/debug"
) )
var filesCache = &filesMap{} var filesCache = &filesMap{}
@ -34,11 +33,6 @@ func ReadFile(s string) ([]byte, error) {
return ioutil.ReadAll(f) return ioutil.ReadAll(f)
} }
func dubeg(key, format string, args ...interface{}) {
s := fmt.Sprintf(format, args...)
debug.Debug("[%s|%s] %s", key, s)
}
func Unpack(ind string) error { func Unpack(ind string) error {
packed = true packed = true
packMU.Lock() packMU.Lock()
@ -99,7 +93,6 @@ func Pack(out io.Writer, paths []Path) error {
continue continue
} }
dubeg("Pack", "%s", p)
filesCache.Store(p, f) filesCache.Store(p, f)
f.Close() f.Close()