Giter Club home page Giter Club logo

Comments (13)

ckaik avatar ckaik commented on June 2, 2024

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.

markbates avatar markbates commented on June 2, 2024

A PR would be excellent!

from packr.

ckaik avatar ckaik commented on June 2, 2024

Sure, I've submitted the PR. Thanks!

from packr.

UlisseMini avatar UlisseMini commented on June 2, 2024

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.

markbates avatar markbates commented on June 2, 2024

from packr.

UlisseMini avatar UlisseMini commented on June 2, 2024

@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.

markbates avatar markbates commented on June 2, 2024

from packr.

UlisseMini avatar UlisseMini commented on June 2, 2024

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.

markbates avatar markbates commented on June 2, 2024

from packr.

UlisseMini avatar UlisseMini commented on June 2, 2024

If packr follows go rules, why does packr build fail when go build is fine?

from packr.

UlisseMini avatar UlisseMini commented on June 2, 2024

I've fixed it by changing templates to _templates, thanks for the help :)

from packr.

markbates avatar markbates commented on June 2, 2024

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.

UlisseMini avatar UlisseMini commented on June 2, 2024

Thanks for explaining, it makes sense now :)

from packr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.