This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Gomod Updates #4
Merged
Merged
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5d954cd
first attempt at using go mod
wild-endeavor b1ca3bd
wip
2f83015
recurse
bb34bf0
wip
ab7afb5
fdsa
ec91ad7
functionize
04e1264
nit
99e0351
nit
1f4c069
address comments (#5)
honnix 4a1fd27
copying go mode
d929928
adding tools and sum files
0307414
wip
95fd5fd
wip
68ee961
wip
33b13bd
wip
1a38b6a
wip
1878f32
update comment
19ae2a9
forgot about enumer
3a35e6f
remove column thing
be1dc60
remove the temporary branch thing, ready to merge
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Everything in this file needs to be installed outside of current module | ||
# The reason we cannot turn off module entirely and install is that we need the replace statement in go.mod | ||
# because we are installing a mockery fork. Turning it off would result installing the original not the fork. | ||
# However, because the installation of these tools themselves sometimes modifies the go.mod/go.sum files. We don't | ||
# want this either. So instead, we're going to copy those files into a temporary directory, do the installation, and | ||
# ignore any changes made to the go mod files. | ||
# (See https://github.com/golang/go/issues/30515 for some background context) | ||
|
||
set -e | ||
|
||
go_install_tool () { | ||
tmp_dir=$(mktemp -d -t gotooling-XXXXXXXXXX) | ||
echo "Installing $1 inside $tmp_dir" | ||
cp go.mod go.sum "$tmp_dir" | ||
pushd "$tmp_dir" | ||
go get "$1" | ||
popd | ||
} | ||
|
||
# List of tools to go get | ||
# In the format of "<cli>:<package>" or ":<package>" if no cli | ||
tools=( | ||
"mockery:github.com/vektra/mockery/cmd/mockery" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @honnix let me take one more look tomorrow before merging this PR. I want to add version numbers in here as well. |
||
"pflags:github.com/lyft/flytestdlib/cli/pflags" | ||
"golangci-lint:github.com/golangci/golangci-lint/cmd/golangci-lint" | ||
"enumer:github.com/alvaroloes/enumer" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add this pleaaase |
||
) | ||
|
||
for tool in "${tools[@]}" | ||
do | ||
cli=$(echo "$tool" | cut -d':' -f1) | ||
package=$(echo "$tool" | cut -d':' -f2) | ||
command -v "$cli" || go_install_tool "$package" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ set -e | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
|
||
OUT="$(mktemp -d)" | ||
git clone [email protected]:lyft/boilerplate.git "${OUT}" | ||
git clone --single-branch --branch gomod [email protected]:lyft/boilerplate.git "${OUT}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will revert this before merging, just here for testing. |
||
|
||
echo "Updating the update.sh script." | ||
cp "${OUT}/boilerplate/update.sh" "${DIR}/update.sh" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops it seems I introduced this empty line.