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

View File

@ -4,15 +4,11 @@ import (
"bytes"
"os"
"os/exec"
"github.com/markbates/pkger/internal/debug"
)
func run(n string, args ...string) ([]byte, error) {
c := exec.Command(n, args...)
debug.Debug("[HERE] %s", c.Args)
bb := &bytes.Buffer{}
c.Stdout = bb
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
}
dubeg("Open", pt.String())
f, ok := filesCache.Load(pt)
if !ok {
return openDisk(pt)
@ -58,7 +57,6 @@ func Open(name string) (*File, error) {
}
func openDisk(pt Path) (*File, error) {
dubeg("openDisk", pt.String())
info, err := Info(pt.Pkg)
if err != nil {
return nil, err

View File

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

View File

@ -12,7 +12,6 @@ import (
"sync"
"github.com/markbates/pkger/here"
"github.com/markbates/pkger/internal/debug"
)
var filesCache = &filesMap{}
@ -34,11 +33,6 @@ func ReadFile(s string) ([]byte, error) {
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 {
packed = true
packMU.Lock()
@ -99,7 +93,6 @@ func Pack(out io.Writer, paths []Path) error {
continue
}
dubeg("Pack", "%s", p)
filesCache.Store(p, f)
f.Close()