git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] persistent-https: add go.mod to fix compile

From
DGDominyk Tiller via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 30, 2021, 13:07 UTC
Message-ID
<pull.989.git.git.1617109668438.gitgitgadget@gmail.com>
From: Dominyk Tiller <dominyktiller@gmail.com>

GOPATH-based builds and non module-aware builds are being deprecated by golang upstream, which currently causes this to fail. This adds a barebones mod file to fix the build.

The `persistent-https` code hasn't been touched for a long time but I assume this is preferable to simply removing it from the codebase.

Before this change:
```
case $(go version) in \
	"go version go"1.[0-5].*) EQ=" " ;; *) EQ="=" ;; esac && \
	go build -o git-remote-persistent-https \
		-ldflags "-X main._BUILD_EMBED_LABEL${EQ}"
go: cannot find main module, but found .git/config in ../git
	to create a module there, run:
	cd ../.. && go mod init
make: *** [git-remote-persistent-https] Error 1
```
Ref: https://blog.golang.org/go116-module-changes.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
---
    persistent-https: add go.mod to fix compile
    
    GOPATH-based builds and non module-aware builds are being deprecated by
    golang upstream, which currently causes this to fail. This adds a
    barebones mod file to fix the build.
    
    The persistent-https code hasn't been touched for a long time but I
    assume this is preferable to simply removing it from the codebase.
    Before this change:
    
    case $(go version) in \
        "go version go"1.[0-5].*) EQ=" " ;; *) EQ="=" ;; esac && \
        go build -o git-remote-persistent-https \
            -ldflags "-X main._BUILD_EMBED_LABEL${EQ}"
    go: cannot find main module, but found .git/config in ../git
        to create a module there, run:
        cd ../.. && go mod init
    make: *** [git-remote-persistent-https] Error 1
    
    
    Ref: https://blog.golang.org/go116-module-changes
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-989%2FDomT4%2Fgo_modules-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-989/DomT4/go_modules-v1
Pull-Request: https://github.com/git/git/pull/989
 contrib/persistent-https/go.mod | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 contrib/persistent-https/go.mod
diff --git a/contrib/persistent-https/go.mod b/contrib/persistent-https/go.mod
new file mode 100644
index 000000000000..6028b1fe5e62
--- /dev/null
+++ b/contrib/persistent-https/go.mod
@@ -0,0 +1,3 @@
+module github.com/git/git/contrib/persistent-https
+
+go 1.16

base-commit: 9198c13e34f6d51c983b31a9397d4d62bc2147ac
-- 
gitgitgadget
Next: Junio C Hamano
Message 1 of 6 in “persistent-https: add go.mod to fix compile”
  1. persistent-https: add go.mod to fix compileDominyk Tiller via GitGitGadget, Mar 30, 2021
  2. Junio C HamanoMar 30, 2021
  3. Dominyk TillerMar 30, 2021
  4. Junio C HamanoMar 30, 2021
  5. Eric SunshineMar 30, 2021
  6. Junio C HamanoMar 30, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.