Comments (13)
I guess the obvious solution would be to include .idea into the list of directories skipped by builder.Builder's Run() method.
I can provide a PR if you like.
from packr.
A PR would be excellent!
from packr.
Sure, I've submitted the PR. Thanks!
from packr.
I have the same issue with my templating program, i have templates that are invalid go code and so it refuses to build
for example
// Copyright {{.Year}} {{.Author}}. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package {{.Project}}
I could work around this by naming them something like .goo
and having my program change the names, but i'd rather this was fixed
from packr.
from packr.
@markbates Maybe i'll do that, seems like a overhead when creating templates since you would need to name them foo.go.tmpl
and that is kind of busywork
from packr.
from packr.
You misunderstand me, go build
works fine packr build
throws this error
➜ gocs git:(master) ✗ packr build
Error: go/src/github.com/UlisseMini/gocs/goc_default/templates/default/{{Project}}.go:5:9: expected 'IDENT', found '{'
Usage:
packr build [flags]
Flags:
-h, --help help for build
Global Flags:
-v, --verbose print verbose logging information
I don't see why packr needs to scan all .go
files including in subdirectories and make sure they are syntastically valid.
from packr.
from packr.
If packr
follows go rules, why does packr build
fail when go build
is fine?
from packr.
I've fixed it by changing templates
to _templates
, thanks for the help :)
from packr.
Just to clarify what's happening. Packr scans your .go files looking for boxes, using go/package. Because those files aren't "proper" go files, the Go tools to parse the package error out. You need to tell Packr to skip those when parsing, to do that it follows the same conventions Go does when trying to figure out what it should/shouldn't build.
from packr.
Thanks for explaining, it makes sense now :)
from packr.
Related Issues (20)
- What parameters need to be changed in the source code of the Full HD application?
- can not get a right import path in go.mod env HOT 1
- Restore entire directory tree HOT 1
- How can I pack a binary and run it from a box?
- <Deleted>
- Unable to install packr on MAC
- Packr v2 not working with Docker HOT 2
- Security vulnerability in required package HOT 2
- Packr2 is running normally, but uses in the GitHub Action environment, the following error occurs: HOT 2
- Please release for GOOS=linux & GOARCH=ppc64le HOT 1
- Vulnerability due to usage of github.com/coreos:etcd:3.3.10
- packr2 does not respect go build's module path
- Source tree and go module versioning HOT 4
- This broke our CI pipeline for several projects :'( HOT 2
- Master branch issue with v2 references HOT 1
- packr build not working after migrating to packr v2 HOT 2
- How do i pack exe into my golang program and run the exe when golang program
- How do i pack my go file with icon and some go build argument while i use packr command
- use packr2 in command line HOT 1
- packr was deprecated and will be archived. please use `embed` instead. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packr.