Codebase list golang-github-gobuffalo-packr / 7e727204-725d-4abc-af4e-63bb6681d94a/upstream example / example.go
7e727204-725d-4abc-af4e-63bb6681d94a/upstream

Tree @7e727204-725d-4abc-af4e-63bb6681d94a/upstream (Download .tar.gz)

example.go @7e727204-725d-4abc-af4e-63bb6681d94a/upstreamraw · history · blame

package example

import (
	"github.com/gobuffalo/packr"
)

var a = packr.NewBox("./foo")

const constString = "./constant"

type S struct{}

func (S) f(packr.Box) {}

func init() {

	b := "./variable"
	packr.NewBox(b)

	packr.NewBox(constString)

	// Cannot work from a function
	packr.NewBox(strFromFunc())

	// This variable should not be added
	fromFunc := strFromFunc()
	packr.NewBox(fromFunc)

	foo("/templates", packr.NewBox("./templates"))
	packr.NewBox("./assets")

	packr.NewBox("./bar")

	s := S{}
	s.f(packr.NewBox("./sf"))
}

func strFromFunc() string {
	return "./fromFunc"
}

func foo(s string, box packr.Box) {}