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

fix bug on resolving import path for diskImportTempl #265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix bug on resolving import path for diskImportTempl #265

wants to merge 1 commit into from

Conversation

jsteuer
Copy link

@jsteuer jsteuer commented Mar 12, 2020

My GOPATH is/home/jsteuer/go:/home/jsteuer/go_dev. If I run packr2 the generated *-packr.go contains the following bad import.

// +build !skippackr
// Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT.

// You can use the "packr clean" command to clean up this,
// and any other packr generated files.
package template_index

import _ "_dev/src/github.com/jsteuer/myproject/packrd"

Because both paths are sharing the substring /home/jsteuer/go the algorithm to calculate the .Import path for diskImportTempl is depending on the order of the GOPATH. (If GO111MODULE=on the problem does not appears - thanks to #183). I think this is bug, so sorting the entries of the GOPATH solves this issue for me:

// +build !skippackr
// Code generated by github.com/gobuffalo/packr/v2. DO NOT EDIT.

// You can use the "packr clean" command to clean up this,
// and any other packr generated files.
package template_index

import _ "github.com/jsteuer/myproject/packrd"

@jsteuer jsteuer requested a review from a team as a code owner March 12, 2020 21:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant