You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go 1.18 introduced workspaces (https://go.dev/doc/tutorial/workspaces) defined by a go.work file defined in the parent directory of a module - these are useful for working with private packages, etc.
I have a setup where my buffalo project depends on a private "common" module for my organisation, and therefore I develop within a go workspace using the following directory structure:
matt@argon:~/ws$ ls
common go.work web
Where web contains my buffalo project, common is the private module, and go.work defined the go workspace.
Unfortunately attempting to use many buffalo-cli commands within this workspace fails with the following error:
matt@argon:~/ws/web$ buffalo task list
Usage:
buffalo task [flags]
Aliases:
task, t, tasks
Flags:
-h, --help help for task
ERRO[0000] Error: here.Dir: /home/matt/ws/web: here.cache: /home/matt//ws/web: here.nonGoDir: /home/matt//ws/web: invalid character '{' after top-level value
The issue appears to be that the here module is unable to handle the JSON returned by go list when executed under a workspace, specifically the output of go list -json -m (called by https://github.com/gobuffalo/here/blob/main/dir.go#L71) returns multiple JSON objects (not in a JSON array!), which then raises the error above when the output is parsed to json.Unmarshal on the following lines...
While arguably this is a go list bug for returning multiple JSON objects outside of a JSON array, the fact that there's a released version of go doing this, to me means that this output format needs to be supported by the here command.
The text was updated successfully, but these errors were encountered:
According to golang/go#46486 the output of go list -json -m is valid JSON, but needs to be passed to json.Decoder, and the output iterated, rather than passed to json.Unmarshal...
There are many issues reporting about it on the go project and they insist that it is working as intended, it is a JSON stream. :-) I don't agree that the FIXED output of the command go list -json is a JSON stream, but if they have no plan to change this weird behavior, we need to fix it.
Go 1.18 introduced workspaces (https://go.dev/doc/tutorial/workspaces) defined by a go.work file defined in the parent directory of a module - these are useful for working with private packages, etc.
I have a setup where my buffalo project depends on a private "common" module for my organisation, and therefore I develop within a go workspace using the following directory structure:
Where
web
contains my buffalo project,common
is the private module, andgo.work
defined the go workspace.Unfortunately attempting to use many buffalo-cli commands within this workspace fails with the following error:
The issue appears to be that the here module is unable to handle the JSON returned by go list when executed under a workspace, specifically the output of
go list -json -m
(called by https://github.com/gobuffalo/here/blob/main/dir.go#L71) returns multiple JSON objects (not in a JSON array!), which then raises the error above when the output is parsed to json.Unmarshal on the following lines...Example go list output:
While arguably this is a
go list
bug for returning multiple JSON objects outside of a JSON array, the fact that there's a released version of go doing this, to me means that this output format needs to be supported by the here command.The text was updated successfully, but these errors were encountered: