A test repo to demonstrate the current (go1.17.2) issue when trying to use retractA test repo to demonstrate the current (go1.17.2) issue when trying to use retract

Overview

test-go-mod-retract

This is a test repo to demonstrate the current (go1.17.2) issue when trying to use retract in go.mod to retract a version in a non-root go.mod file.

Git version history

The first git commit, created by github, has the following files:

README.md
LICENCE

The second git commit (2d05d02), which is recognized by go toolchain as v0.0.0-20211016165524-2d05d02ee912, has the following files:

README.md
LICENSE
lib/
  go.mod
  lib.go

This commit demonstrates a common mistake scenario: the project put the go.mod file under a non-root directory without realizing the consequences 0 of it.

Then, the third git commit (189fa58), which is also later tagged as v0.1.0, tries to correct the mistake from the previous commit, by removing lib/go.mod and add it to the root directory instead:

README.md
LICENSE
go.mod
lib/
  lib.go

This makes https://pkg.go.dev/github.com/fishy/[email protected]/lib work, but at the same time, it shows that v0.1.0 is not the "latest" version of this module, and the latest version is v0.0.0-20211016165524-2d05d02ee912. When you try go mod get github.com/fishy/test-go-mod-retract/[email protected], it will grab v0.0.0-20211016165524-2d05d02ee912, go mod get github.com/fishy/[email protected] will correctly grab v0.1.0.

So the fourth commit (fb96cca) tries to retract v0.0.0-20211016165524-2d05d02ee912, by adding the following line 1 into root go.mod file:

retract v0.0.0-20211016165524-2d05d02ee912

This does NOT work as intended, because currently retract can only be used to retract versions from the same go.mod, not other go.mod from the same repository.

Thanks to @seankhliao 2, it's possible to add back lib/go.mod, retract all versions up to a future version:

retract [v0.0.0-00000000000000-000000000000, v0.0.1-retract]

And then tag that version as lib/v0.0.1-retract. This successfully resolved the issue. lib/go.mod can be removed in the next commit.

Owner
Yuxuan 'fishy' Wang
Yuxuan 'fishy' Wang
Issue Reaction Counter with golang

Below is the title and reaction count for issues filed in this repository

Developer Relations at Algorand 3 Nov 25, 2021
Some helper types for go1: priority queue, slice wrapper.

go-villa Package villa contains some helper types for Go: priority queue, slice wrapper, binary-search, merge-sort. GoDoc Link: http://godoc.org/githu

Yi Deng 53 Apr 24, 2021
Simple Golang API to demonstrate file upload to fireabase storage and retrieving url of uploaded file.

go-firebase-storage -Work in progress ??️ Simple Golang API that uses Firebase as its backend to demonstrate various firebase services using Go such a

Victor Kabata 4 Oct 4, 2021
A sample golang project to demonstrate the integration with rancher pipeline

pipeline-example-go This is a sample golang project to demonstrate the integration with rancher pipeline. Building go build -o ./bin/hello-server Runn

null 0 Oct 30, 2021
A toy repo used to test the functionality of "go mod why".

Mod Why Test Discussion From a module perspective: The main module (github.com/ejweber/mod-why-test) has a single direct dependency (github.com/ejwebe

Eric Weber 1 Dec 1, 2021
A file wiper (for the current directory) written in Go

A file wiper (for the current directory) written in Go. Rewrites all files within all accessible directories from the current directory, including itself. to be blank, usually making victims think nothing was harmed.

null 0 Dec 5, 2021
Hack this repo and add your name to the list above. Creativity and style encouraged in both endeavors.

Hack this repo and add your name to the list above. Creativity and style encouraged in both endeavors.

Danger 2 Oct 1, 2021
Auto-updating F-Droid repo using GitHub Actions

fdroid This repository hosts an F-Droid repo for my apps. This allows you to install and update apps very easily. How to use At first, you should inst

Philipp 1 Dec 6, 2021
Monitor star changes of GitHub repo, and send the notification to slack or lark.

stargazers Features monitor the star events of the GitHub repo send the notifications to Slack or Lark How to use For Lark, create a bot called like s

Kevin Wan 8 Dec 1, 2021
Orkestra Workflow Executor Template Repo

Orkestra Workflow Executor Template Repo This is a template repository for a new workflow executor Usage Generate your repository from this template b

Nitish Malhotra 0 Nov 9, 2021
OpenFunction Sample Repo

OpenFunction Samples Installation Version OpenFunction v0.4.0 Setup a Cluster minikube start -p demo --kubernetes-version=v1.22.2 --network-plugin=cni

Lize 1 Nov 23, 2021
James is your butler and helps you to create, build, debug, test and run your Go projects

go-james James is your butler and helps you to create, build, debug, test and run your Go projects. When you often create new apps using Go, it quickl

Pieter Claerhout 45 Oct 26, 2021
Enrich `go test` outputs with text decorations.

richgo Rich-Go will enrich go test outputs with text decorations Installation (go get): go get -u github.com/kyoh86/richgo (homebrew): brew tap kyoh8

Kyoichiro Yamada 632 Dec 1, 2021
Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Charles Weill 3.6k Dec 7, 2021
Solution to elevator test problem but this time recursive and in go

Synopsis A multi-floor building has a Lift in it. People are queued on different floors waiting for the Lift. Some people want to go up. Some people w

Alex Piemont 0 Nov 8, 2021
Implementation of the test task, chat in the goland language

Implementation of the test task, chat in the goland language

Dmitriy Fofanov 0 Nov 12, 2021
A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths.

A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths. If you have not the compiled file (.exe) you can build it with the Go compiler.

Francesco Fontana 0 Nov 15, 2021
MNC Technical Test With Golang

MNC Technical Test With Golang

Angga Suwito 0 Nov 20, 2021
Extensions for the melatonin test framework

melatonin-ext - Extensions for the melatonin test framework These packages extend melatonin to provide additional test contexts for testing various 3r

Jeff Linse 0 Nov 27, 2021