go: cannot match "all": go.mod file not found

This issue has been created since 2022-07-12.
$ go version
go version go1.18.3 linux/amd64
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/roukmoute/.cache/go-build"
GOENV="/home/roukmoute/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/roukmoute/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/roukmoute/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build239843618=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Just try to use xcaddy.

https://asciinema.org/a/507891

What did you expect to see?

A converted file

What did you see instead?

go: cannot match "all": go.mod file not found in current directory or any parent directory; see 'go help modules'
2022/07/12 07:01:47 [ERROR] exec [go list -m -json all]: exit status 1: 
francislavoie wrote this answer on 2022-07-19

You ran xcaddy adapt... What do you expect to happen exactly?

If you run xcaddy with anything other than xcaddy build, you're using it in dev mode, which expects a go.mod to be found in the current directory, i.e. to make a build of Caddy plus the plugin in the current directory. This is a tool for plugin developers.

Looks like you're trying to adapt an nginx config. That requires the nginx-adapter plugin. For that, you would build Caddy with xcaddy build --with github.com/caddyserver/nginx-adapter, and then use ./caddy, the built binary, to run it.

roukmoute wrote this answer on 2022-07-19

Ok thanks!

I'm beginning in go and all this stuff is a little bit confusing.

More Details About Repo
Owner Name caddyserver
Repo Name xcaddy
Full Name caddyserver/xcaddy
Language Go
Created Date 2020-03-21
Updated Date 2022-09-22
Star Count 381
Watcher Count 14
Fork Count 72
Issue Count 3

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Error when buffer is not modifiable 0 2022-08-05 2022-09-09
Publish with Docker GitHub Action 2 2020-05-04 2022-09-13
Use variable withing python strings 2 2021-03-12 2022-09-26
Search field not present on pages 9 2022-04-04 2022-08-21
[CDRWin] Converting specific CDRWin CUE image to Aaru Format crashes 0 2021-07-23 2022-09-29
Add support for changing refresh rate and color depth with HDR 4 2021-05-02 2022-07-28
AutoHDR and admin rights 10 2021-10-25 2022-07-26
Add support for the opposite behavior (disable HDR once an application launches) 9 2021-04-14 2022-09-11
[Suggestion] A button to turn Auto-HDR on/off 4 2021-03-17 2022-05-17
[Suggestion] Support for keyboard shortcut or CLI 6 2021-03-17 2022-07-26
Tile editor compatibility 3 2018-02-05 2022-09-16
Should enums be downsized? 0 2021-10-21 2022-08-20
RR interval updates after filtering bad peaks 1 2021-11-24 2022-08-29
How to encrypt sessionStorage using vuex-persistedstate? 1 2021-07-28 2022-09-09
Disabling --framework due to missing Python library 6 2019-06-15 2022-08-04
nmap module attributes 2 2021-07-02 2022-07-21
Incorrect SMT logging in the arrays encoding 0 2022-04-05 2022-07-19
Aqara Wireless Remote Switch H1 loosing connection every two days 1 2021-10-17 2022-09-10
Refit on Dapr client calling 1 2021-02-28 2022-09-04
Random backup freeze 19 2022-06-12 2022-09-25
max_pool1d regression in functorch 5 2022-01-28 2022-09-25
Localmonero 9000usd Scam and must be removed from getmonero.org/community/merchants/ 2 2021-11-24 2022-09-02
btrfs compression not configured. 4 2022-06-04 2022-08-26
FileReference tree view shows error in the label column 1 2021-09-09 2022-08-15
No module names 'six' and 'pkg_resources' 3 2020-11-08 2022-09-11
Unable to sync on new devices 2 2022-07-27 2022-09-05
Ability to redirect login and logout to my account page (suitable for WooCommerce) Elementor pro 6 2022-01-23 2022-07-17
Describe how to open files through IO plugins 0 2021-05-28 2022-09-18
ESLint Complains About Optional Chaining 0 2022-08-07 2022-09-10
sf 1.0.4 looks for libgeos-3.8.0, libproj15 and libgdal26. 15 2021-11-21 2022-09-15
Tests Broken in v0.15.0 `function uuid_generate_v4() does not exist` 0 2021-10-19 2022-08-06
Wildcard cluster id with non-global attributes or wildcard attribute paths shoul... 0 2021-11-17 2022-07-03
Can't figure out how to run Matomo from the package. 9 2018-07-26 2022-09-27
A potential risk can be leveraged to generate out-of-band workloads in Kata-containers 0 2022-08-17 2022-08-27
Improve UserDataModule documentation and clarity 1 2021-09-03 2022-09-22
error opening an image or WEBP file 2 2022-08-19 2022-09-16
Display issue in the Account page of polkadot.js.org 5 2022-03-22 2022-07-19
IBM Cloud Container Registry Vulnerability Advisor Support 2 2021-04-27 2022-09-21
Add a CORS policy to the master playlist buckets 1 2020-03-24 2022-09-26
­čÉ×README.md contain markup 0 2022-06-07 2022-09-11
Type parameter is lost when using a typedef for a mixin 6 2022-06-08 2022-09-17
Create cluster page display incorrect cluster type 7 2022-03-24 2022-08-06
Issue booting k3OS on Raspberry Pi4B 2 2021-03-08 2022-09-24
Notebooks: Re-export Task button 0 2021-11-22 2022-07-24
unsupport select databases(); 1 2022-08-15 2022-08-12
This version of ShardingSphere-Proxy doesn't yet support this SQL. 2 2022-08-15 2022-08-16
`\bigvee` is poorly defined 0 2021-10-13 2022-09-18
Upgrade to Netty 4.1.79.Final 0 2022-07-15 2022-09-28
Upgrade to MongoDB 4.7.0-beta0 0 2022-07-15 2022-09-17
Upgrade to Neo4j Java Driver 4.4.9 0 2022-07-15 2022-09-23