mirror of https://github.com/markbates/pkger.git
Fixes high cache miss rate, significant performance increase. Closes #92
This commit is contained in:
parent
c028e66556
commit
efed726c9e
|
@ -8,8 +8,8 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
|
||||||
"github.com/markbates/pkger"
|
"github.com/markbates/pkger"
|
||||||
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/parser"
|
"github.com/markbates/pkger/parser"
|
||||||
"github.com/markbates/pkger/pkging/pkgutil"
|
"github.com/markbates/pkger/pkging/pkgutil"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/parser"
|
"github.com/markbates/pkger/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
|
||||||
"github.com/markbates/pkger"
|
"github.com/markbates/pkger"
|
||||||
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pathCmd struct {
|
type pathCmd struct {
|
||||||
|
|
|
@ -8,6 +8,7 @@ type Info = here.Info
|
||||||
type Module = here.Module
|
type Module = here.Module
|
||||||
type Path = here.Path
|
type Path = here.Path
|
||||||
|
|
||||||
var Dir = here.Dir
|
var Here = here.New()
|
||||||
var Package = here.Package
|
var Dir = Here.Dir
|
||||||
var Current = here.Current
|
var Package = Here.Package
|
||||||
|
var Current = Here.Current
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Infos wraps sync.Map and uses the following types:
|
// Infos wraps sync.Map and uses the following types:
|
||||||
|
|
|
@ -3,7 +3,7 @@ package parser
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
type File struct {
|
type File struct {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Decl = IncludeDecl{}
|
var _ Decl = IncludeDecl{}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
var defaultIgnoredFolders = []string{".", "_", "vendor", "node_modules", "testdata"}
|
var defaultIgnoredFolders = []string{".", "_", "vendor", "node_modules", "testdata"}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging/pkgtest"
|
"github.com/markbates/pkger/pkging/pkgtest"
|
||||||
"github.com/markbates/pkger/pkging/stdos"
|
"github.com/markbates/pkger/pkging/stdos"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Decl = WalkDecl{}
|
var _ Decl = WalkDecl{}
|
||||||
|
|
2
pkger.go
2
pkger.go
|
@ -6,7 +6,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
"github.com/markbates/pkger/pkging/stdos"
|
"github.com/markbates/pkger/pkging/stdos"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/internal/takeon/github.com/markbates/hepa"
|
"github.com/markbates/pkger/internal/takeon/github.com/markbates/hepa"
|
||||||
"github.com/markbates/pkger/internal/takeon/github.com/markbates/hepa/filters"
|
"github.com/markbates/pkger/internal/takeon/github.com/markbates/hepa/filters"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package embed
|
package embed
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
type File interface {
|
type File interface {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging/mem"
|
"github.com/markbates/pkger/pkging/mem"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@ package mem
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/internal/maps"
|
"github.com/markbates/pkger/internal/maps"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
"github.com/markbates/pkger/pkging/embed"
|
"github.com/markbates/pkger/pkging/embed"
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/internal/maps"
|
"github.com/markbates/pkger/internal/maps"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Pkger interface {
|
type Pkger interface {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Ref struct {
|
type Ref struct {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/parser"
|
"github.com/markbates/pkger/parser"
|
||||||
"github.com/markbates/pkger/pkging/embed"
|
"github.com/markbates/pkger/pkging/embed"
|
||||||
"github.com/markbates/pkger/pkging/mem"
|
"github.com/markbates/pkger/pkging/mem"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package stdos
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/internal/maps"
|
"github.com/markbates/pkger/internal/maps"
|
||||||
"github.com/markbates/pkger/pkging"
|
"github.com/markbates/pkger/pkging"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/gobuffalo/here"
|
"github.com/markbates/pkger/here"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Wrap(parent, with Pkger) Pkger {
|
func Wrap(parent, with Pkger) Pkger {
|
||||||
|
|
Loading…
Reference in New Issue