GithubHelp home page GithubHelp logo

vend's People

Contributors

c00w avatar lespea avatar nomad-software avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vend's Issues

Create a Website for this Repo

Hi there.

Is there a website for this repo?

Because if you don't have, well, this repo can simply be turned into a website right away. Others will discover this project in that website.

Steps:

  1. Go to Settings and look for GitHub Pages, scroll down. That's almost at the bottom.

  2. You will see there: Branch:none, so you should change that to master because you have a README.md file in the master repo. This will be your page. Click Save first.

  3. Then click Choose a theme, you select a predefined theme of your site.

  4. Visit your site now! The URL will be https://nomad-software.github.io/vend.

If you were amazed by that, simply read the documentation about GitHub Pages.

modules.txt is missing explicit tags

Without these tags go 1.14 errors with {module} is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

Example: https://golang.org/src/vendor/modules.txt

I'm currently getting around this by running go mod vendor, saving their version of modules.txt, running vend, then overriding the new modules.txt with the go mod version. I did notice that the files are different with go mod listing more sub-paths of modules and outright excluding others. This is for an internal project so I can't really share a working example, sorry.

Copies Go files that the running Go version can't parse.

If a vendored module has //go:build go1.18 lines while running go1.17 then running gofmt -l . (as a CI formatting check, for example) errors out because go1.17 doesn't understand go1.18 generics syntax. Seems like go vet and go build are smart enough to avoid those files, however. Can work around this with a more complex gofmt line that avoids vendor directory, like find . \( -path ./vendor -prune \) -o -type f -name \*.go -print0 | xargs -0 gofmt -l, so not sure exactly how urgent this is, but a parameter to avoid them would help.

Example Go file:

package main

import (
	"fmt"

	"golang.org/x/tools/godoc/util"
)

func main() {
	fmt.Println(util.IsText([]byte("foo")))
}

go mod vendor:

$ rm -rf vendor; go mod vendor; gofmt -l .; echo $?
0

vend:

$ rm -rf vendor; go run --mod=mod github.com/nomad-software/vend > /dev/null; gofmt -l . 2>&1 | grep : | tail
go: finding module for package github.com/nomad-software/vend
vendor/golang.org/x/tools/internal/lsp/testdata/keywords/empty_select.go:7:1: expected declaration, found '}'
vendor/golang.org/x/tools/internal/lsp/testdata/keywords/empty_switch.go:9:3: expected '}', found d
vendor/golang.org/x/tools/internal/lsp/testdata/keywords/empty_switch.go:11:1: expected declaration, found '}'
vendor/golang.org/x/tools/internal/lsp/testdata/keywords/keywords.go:71:1: expected operand, found '}'
vendor/golang.org/x/tools/internal/lsp/testdata/keywords/keywords.go:100:52: expected ';', found 'EOF'
vendor/golang.org/x/tools/internal/lsp/testdata/snippets/literal.go:21:2: expected operand, found '}'
vendor/golang.org/x/tools/internal/lsp/testdata/snippets/literal.go:22:2: missing ',' in composite literal
vendor/golang.org/x/tools/internal/lsp/testdata/statements/if_err_check_return.go:22:2: expected boolean expression, found assignment (missing parentheses around composite literal?)
vendor/golang.org/x/tools/internal/lsp/testdata/statements/if_err_check_return.go:26:2: expected operand, found 'if'
vendor/golang.org/x/tools/internal/lsp/testdata/statements/if_err_check_return.go:27:3: expected '}', found 'EOF'

vend -package seems vendor extra dependencies

how to reproduce ?

  1. clone github.com/qor/qor-example,
  2. go mod init
  3. vend -package github.com/qor/admin

in my case, it copies

~/src/qor-demo λ  tree -L 1 vendor/
vendor/
├── github.com
├── go.uber.org
├── golang.org
└── modules.txt

at least qor/admin has no denpendency on zap or golang/x

vendor proto files

Does this tool help to vendor proto files? I'm need it to generate my own code. Now i'm simply copy needed files to my local package proto dir

vend deleted go.exe

I... seriously.

$ go get github.com/nomad-software/vend
go: finding github.com/nomad-software/vend latest
go: finding golang.org/x/sys v0.0.0-20181218192612-074acd46bca6
go: downloading github.com/nomad-software/vend v0.0.0-20181222113412-fb70e2a0dee9
go: extracting github.com/nomad-software/vend v0.0.0-20181222113412-fb70e2a0dee9

$ cd <project directory in question>

$ vend
download:, exit status 1073741845

$ vend -package
tidy:, exec: "go": executable file not found in %PATH%

$ go
'go' is not recognized as an internal or external command,
operable program or batch file.

$ which go
which: no go in (C:\Program Files\...snip...)

$ dir c:\go\bin
 Volume in drive C is OS
 Volume Serial Number is 58BF-59A1

 Directory of c:\go\bin

04/02/2019  10:16 AM    <DIR>          .
04/02/2019  10:16 AM    <DIR>          ..
02/25/2019  11:09 PM        17,127,424 godoc.exe
02/25/2019  11:09 PM         3,640,320 gofmt.exe
               2 File(s)     20,767,744 bytes
               2 Dir(s)  176,467,365,888 bytes free

Fix vendoring of deps of go mod deps

Currently, only modules in the required modules list are copied into the vendor directory. However, go mod vendor copies all dependencies. This includes modules in the requires modules list of dependencies that also use go modules. go build -mod=vendor will fail with missing dependencies after vend, but not after go mod vendor in this case.

Support modules with replacements

during copying, the original module path is used for the module source. if the module should be replaced via a replace statement in go.mod, then the replacing module path should be used.

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.