Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

packr.NewBox finds no boxes when passed a pointer #251

Open
peterfraedrich opened this issue Nov 16, 2019 · 0 comments
Open

packr.NewBox finds no boxes when passed a pointer #251

peterfraedrich opened this issue Nov 16, 2019 · 0 comments

Comments

@peterfraedrich
Copy link

Packr is unable to find boxes when using a string pointer as the packr.NewBox() path.

This code fails to create a box when packr is run:

package main

import (
	"flag"
	"fmt"
	"os"

	"github.com/gobuffalo/packr/v2"
)

func main() {
    var configPath = flag.String("path", "./repack", "Relative path to the repack directory")
    flag.Parse()
    if *configPath == "" {
	    fmt.Println("You must provide the absolute path to your repack directory")
	    os.Exit(1)
    }   
    box := packr.NewBox(*configPath)
}

If the path to box : = packr.NewBox() is set to a string then everything works as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant