Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func buildVersionString() (string, error) {

fmt.Fprintf(versionsWriter, "container image versions:\n")
imageReplacements := strings.Trim(string(cmd.ReleaseImageReplacements), "\n")
for _, image := range strings.Split(imageReplacements, "\n") {
for image := range strings.SplitSeq(imageReplacements, "\n") {
if !strings.HasPrefix(image, "#") {
image = strings.Split(image, "=")[1]
fmt.Fprintf(versionsWriter, "\t%s\n", image)
Expand Down
6 changes: 2 additions & 4 deletions coordinator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ func newGRPCServer(credentials credentials.TransportCredentials, serverMetrics *
}

func gracefulStopGRPC(ctx context.Context, wg *sync.WaitGroup, server *grpc.Server) {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
cleanupDone := make(chan struct{})
go func() {
server.GracefulStop()
Expand All @@ -327,5 +325,5 @@ func gracefulStopGRPC(ctx context.Context, wg *sync.WaitGroup, server *grpc.Serv
server.Stop()
case <-cleanupDone:
}
}()
})
}
13 changes: 6 additions & 7 deletions packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,17 @@ lib.makeScope pkgs.newScope (scripts: {
text = ''
exitcode=0

tags="${lib.concatStringsSep "," contrastPkgs.contrast.contrast.tags}"
export GOFLAGS="-tags=${lib.concatStringsSep "," contrastPkgs.contrast.contrast.tags}"
export CGO_ENABLED=0

while IFS= read -r dir; do
echo "Running go fix -tags $tags on $dir"
go fix -C "$dir" -tags "$tags" ./... || exitcode=$?
echo "Running go fix on $dir"
go fix -C "$dir" ./... || exitcode=$?
done < <(go list -f '{{.Dir}}' -m)

# TODO(katexochen): modernize does not support tags?
# The run will fail for packages that contain only code with build tags,
# thus we ignore the exit code.
while IFS= read -r dir; do
echo "Running modernize on $dir"
(cd "$dir" && modernize -fix ./...) || true
(cd "$dir" && modernize -fix ./...) || exitcode=$?
done < <(go list -f '{{.Dir}}' -m)

exit $exitcode
Expand Down