Comments (8)
Hey @zachgersh this is totally something I've wanted before.
Are you interested in submitting a PR for this?
from counterfeiter.
Sure, did the SHA as version sound good or did we want to go with something else?
On Apr 8, 2016, at 12:46 AM, Tim Jarratt [email protected] wrote:
Hey @zachgersh this is totally something I've wanted before.
Are you interested in submitting a PR for this?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
from counterfeiter.
If that's expedient and makes the tool still work with "go get" then that's good for me.
Sent From A Very Small Keyboard
On Apr 8, 2016, at 06:57, Zach Gershman [email protected] wrote:
Sure, did the SHA as version sound good or did we want to go with something else?
On Apr 8, 2016, at 12:46 AM, Tim Jarratt [email protected] wrote:
Hey @zachgersh this is totally something I've wanted before.
Are you interested in submitting a PR for this?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
from counterfeiter.
It'd be great to see this version flag added. Our team is struggling with having different versions on Counterfeiter on different machines (and subsequently the different behaviour between versions as the tool evolves).
One approach could be using -ldflags
during the build, as detailed in this blog post. This could be populated with the git SHA. The difficulty in this approach is how to populate these arguments when a user is running go get
. Does anyone know if golang has a mechanism to default build args?
Alternatively, could the version info could be committed in the source code and incremented per release? Like this example.
I'd be happy to help out with this. Is there a preference on the direction?
from counterfeiter.
Yes please
from counterfeiter.
I think making releases of counterfeiter more often, and attaching binaries to the github release could help alleviate this.
If we change the distribution mechanism from go get
to downloading a binary from github, we can better handle versioning schemes, and provide actual versioning for counterfeiter.
from counterfeiter.
@chendrix That sounds good. If the version number is committed in the source it wouldn't prevent people from using go get
if they still wanted to.
from counterfeiter.
Given that counterfeiter is now a go module
, and we plan to use semver
and tags to release versions, I believe this issue is solved. There is an approach using tools.go
that permits you to have take a module dependency on the tools your project uses, so that you can have reproducibility across machines.
Excerpt from golang/go#27653:
# create a new module
cd $(mktemp -d)
mkdir hello
cd hello
go mod init example.com/hello
# set GOBIN as a module-local install target
export GOBIN=$PWD/.bin
# update my PATH accordingly (I actually use https://github.com/cxreg/smartcd for this)
export PATH=$GOBIN:$PATH
# add a tool dependency (by definition, category 1 tool) following "best practice" laid out in
# https://github.com/golang/go/issues/25922#issuecomment-412992431
cat <<EOD > tools.go
// +build tools
package tools
import (
_ "golang.org/x/tools/cmd/stringer"
)
EOD
# install the tool
go install golang.org/x/tools/cmd/stringer
# verify we are using the module-local binary
which stringer
# which gives something like:
# /tmp/tmp.Hh0BNOF6k2/hello/.bin/stringer
from counterfeiter.
Related Issues (20)
- Support overriding destination package name and type naming template in "-generate" call HOT 5
- Support for DoThingsCallsOnCall(callCount, stub ...) similar to DoThingsReturnsOnCall(callCount)
- How to use shorthand generate directive for external packages? HOT 1
- cannot find GOROOT directory HOT 1
- Go 1.18 generics HOT 8
- cannot write tests in package being tested due to import cycle
- [CVE-2020-11022] Update of counterfeiter/v6 needed HOT 2
- Homebrew: Does not complete test on Go 1.20rc1 HOT 4
- disable CircleCI HOT 2
- cannot use json.Marshal(h) (value of type []byte) as driver.Value value in return statement HOT 1
- Support for callback func stub? HOT 1
- Cannot regenerate fakes if they are relied upon and deleted - go1.19.10 HOT 1
- About the latest release HOT 6
- Allow setting destination package name independent of directory name
- Excessive memory usage when generating multiple fakes with `counterfeiter:generate` directives.
- Counterfeiter does not generate private interface methods (used in `grpc-go`) HOT 1
- generation fails when interfaces are declared in a type block.
- Generate doesn't import packages referenced in type args
- Import cycle is not allowed in test
- Support Go 1.22 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 counterfeiter.