mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
bump(github.com/elazarl/go-bindata-assetfs): 3dcc96556217539f50599357fb481ac0dc7439b9
This commit is contained in:
parent
28585bc699
commit
b546045c44
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@ -211,7 +211,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/elazarl/go-bindata-assetfs",
|
"ImportPath": "github.com/elazarl/go-bindata-assetfs",
|
||||||
"Rev": "c57a80f1ab2ad67bafa83f5fd0b4c2ecbd253dd5"
|
"Rev": "3dcc96556217539f50599357fb481ac0dc7439b9"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/emicklei/go-restful",
|
"ImportPath": "github.com/emicklei/go-restful",
|
||||||
|
8
Godeps/_workspace/src/github.com/elazarl/go-bindata-assetfs/assetfs.go
generated
vendored
8
Godeps/_workspace/src/github.com/elazarl/go-bindata-assetfs/assetfs.go
generated
vendored
@ -136,12 +136,12 @@ func (fs *AssetFS) Open(name string) (http.File, error) {
|
|||||||
if len(name) > 0 && name[0] == '/' {
|
if len(name) > 0 && name[0] == '/' {
|
||||||
name = name[1:]
|
name = name[1:]
|
||||||
}
|
}
|
||||||
|
if b, err := fs.Asset(name); err == nil {
|
||||||
|
return NewAssetFile(name, b), nil
|
||||||
|
}
|
||||||
if children, err := fs.AssetDir(name); err == nil {
|
if children, err := fs.AssetDir(name); err == nil {
|
||||||
return NewAssetDirectory(name, children, fs), nil
|
return NewAssetDirectory(name, children, fs), nil
|
||||||
}
|
} else {
|
||||||
b, err := fs.Asset(name)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return NewAssetFile(name, b), nil
|
|
||||||
}
|
}
|
||||||
|
41
Godeps/_workspace/src/github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs/main.go
generated
vendored
41
Godeps/_workspace/src/github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs/main.go
generated
vendored
@ -3,13 +3,31 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const bindatafile = "bindata.go"
|
const bindatafile = "bindata.go"
|
||||||
|
|
||||||
|
func isDebug(args []string) bool {
|
||||||
|
flagset := flag.NewFlagSet("", flag.ContinueOnError)
|
||||||
|
debug := flagset.Bool("debug", false, "")
|
||||||
|
debugArgs := make([]string, 0)
|
||||||
|
for _, arg := range args {
|
||||||
|
if strings.HasPrefix(arg, "-debug") {
|
||||||
|
debugArgs = append(debugArgs, arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flagset.Parse(debugArgs)
|
||||||
|
if debug == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return *debug
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if _, err := exec.LookPath("go-bindata"); err != nil {
|
if _, err := exec.LookPath("go-bindata"); err != nil {
|
||||||
fmt.Println("Cannot find go-bindata executable in path")
|
fmt.Println("Cannot find go-bindata executable in path")
|
||||||
@ -33,26 +51,43 @@ func main() {
|
|||||||
fmt.Fprintln(os.Stderr, "Cannot write 'bindata_assetfs.go'", err)
|
fmt.Fprintln(os.Stderr, "Cannot write 'bindata_assetfs.go'", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
debug := isDebug(os.Args[1:])
|
||||||
r := bufio.NewReader(in)
|
r := bufio.NewReader(in)
|
||||||
done := false
|
done := false
|
||||||
for line, isPrefix, err := r.ReadLine(); err == nil; line, isPrefix, err = r.ReadLine() {
|
for line, isPrefix, err := r.ReadLine(); err == nil; line, isPrefix, err = r.ReadLine() {
|
||||||
line = append(line, '\n')
|
if !isPrefix {
|
||||||
|
line = append(line, '\n')
|
||||||
|
}
|
||||||
if _, err := out.Write(line); err != nil {
|
if _, err := out.Write(line); err != nil {
|
||||||
fmt.Fprintln(os.Stderr, "Cannot write to 'bindata_assetfs.go'", err)
|
fmt.Fprintln(os.Stderr, "Cannot write to 'bindata_assetfs.go'", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !done && !isPrefix && bytes.HasPrefix(line, []byte("import (")) {
|
if !done && !isPrefix && bytes.HasPrefix(line, []byte("import (")) {
|
||||||
fmt.Fprintln(out, "\t\"github.com/elazarl/go-bindata-assetfs\"")
|
if debug {
|
||||||
|
fmt.Fprintln(out, "\t\"net/http\"")
|
||||||
|
} else {
|
||||||
|
fmt.Fprintln(out, "\t\"github.com/elazarl/go-bindata-assetfs\"")
|
||||||
|
}
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Fprintln(out, `
|
if debug {
|
||||||
|
fmt.Fprintln(out, `
|
||||||
|
func assetFS() http.FileSystem {
|
||||||
|
for k := range _bintree.Children {
|
||||||
|
return http.Dir(k)
|
||||||
|
}
|
||||||
|
panic("unreachable")
|
||||||
|
}`)
|
||||||
|
} else {
|
||||||
|
fmt.Fprintln(out, `
|
||||||
func assetFS() *assetfs.AssetFS {
|
func assetFS() *assetfs.AssetFS {
|
||||||
for k := range _bintree.Children {
|
for k := range _bintree.Children {
|
||||||
return &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: k}
|
return &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: k}
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}`)
|
}`)
|
||||||
|
}
|
||||||
// Close files BEFORE remove calls (don't use defer).
|
// Close files BEFORE remove calls (don't use defer).
|
||||||
in.Close()
|
in.Close()
|
||||||
out.Close()
|
out.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user