hairyhenderson / gomplate

A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
https://gomplate.ca
MIT License
2.5k stars 176 forks source link

Issue Running Gomplate with `go run` due to Module Path Mismatch #2025

Closed SolomonRosemite closed 2 months ago

SolomonRosemite commented 2 months ago

Hi,

I've encountered an issue when trying to run gomplate using the go run command. When trying to do so, I get the following error:

$ go run github.com/hairyhenderson/gomplate@v3
go: finding module for package github.com/spf13/afero
go: finding module for package github.com/aws/aws-sdk-go/service/secretsmanager
go: finding module for package github.com/joho/godotenv
go: finding module for package github.com/Masterminds/goutils
go: finding module for package github.com/google/uuid
go: finding module for package github.com/pkg/errors
go: finding module for package github.com/gosimple/slug
go: finding module for package github.com/ugorji/go/codec
go: finding module for package github.com/Shopify/ejson/json
go: finding module for package github.com/aws/aws-sdk-go/service/ssm
go: finding module for package github.com/aws/aws-sdk-go/aws
go: finding module for package github.com/hashicorp/go-sockaddr
go: finding module for package github.com/zealic/xignore
go: finding module for package github.com/hairyhenderson/toml
go: finding module for package github.com/Shopify/ejson
go: finding module for package gopkg.in/hairyhenderson/yaml.v2
go: finding module for package github.com/hashicorp/go-sockaddr/template
go: finding module for package golang.org/x/crypto/bcrypt
go: finding module for package github.com/aws/aws-sdk-go/aws/session
go: finding module for package github.com/aws/aws-sdk-go/service/ec2
go: finding module for package github.com/aws/aws-sdk-go/service/kms
go: finding module for package github.com/aws/aws-sdk-go/service/sts
go: finding module for package k8s.io/client-go/util/jsonpath
go: finding module for package github.com/docker/libkv
go: finding module for package github.com/docker/libkv/store
go: finding module for package github.com/docker/libkv/store/boltdb
go: finding module for package github.com/docker/libkv/store/consul
go: finding module for package github.com/hashicorp/consul/api
go: finding module for package github.com/hashicorp/vault/api
go: finding module for package golang.org/x/crypto/pbkdf2
go: found github.com/pkg/errors in github.com/pkg/errors v0.9.1
go: found github.com/spf13/afero in github.com/spf13/afero v1.11.0
go: found github.com/zealic/xignore in github.com/zealic/xignore v0.3.3
go: found github.com/Shopify/ejson in github.com/Shopify/ejson v1.5.0
go: found github.com/Shopify/ejson/json in github.com/Shopify/ejson v1.5.0
go: found github.com/aws/aws-sdk-go/aws in github.com/aws/aws-sdk-go v1.51.2
go: found github.com/aws/aws-sdk-go/service/secretsmanager in github.com/aws/aws-sdk-go v1.51.2
go: found github.com/aws/aws-sdk-go/service/ssm in github.com/aws/aws-sdk-go v1.51.2
go: found github.com/hairyhenderson/toml in github.com/hairyhenderson/toml v0.4.1
go: found github.com/joho/godotenv in github.com/joho/godotenv v1.5.1
go: found github.com/ugorji/go/codec in github.com/ugorji/go/codec v1.2.12
go: found gopkg.in/hairyhenderson/yaml.v2 in gopkg.in/hairyhenderson/yaml.v2 v2.4.0
go: found github.com/Masterminds/goutils in github.com/Masterminds/goutils v1.1.1
go: found github.com/google/uuid in github.com/google/uuid v1.6.0
go: found github.com/gosimple/slug in github.com/gosimple/slug v1.14.0
go: found github.com/hashicorp/go-sockaddr in github.com/hashicorp/go-sockaddr v1.0.6
go: found github.com/hashicorp/go-sockaddr/template in github.com/hashicorp/go-sockaddr v1.0.6
go: found golang.org/x/crypto/bcrypt in golang.org/x/crypto v0.21.0
go: found github.com/aws/aws-sdk-go/aws/session in github.com/aws/aws-sdk-go v1.51.2
go: found github.com/aws/aws-sdk-go/service/ec2 in github.com/aws/aws-sdk-go v1.51.2
go: found github.com/aws/aws-sdk-go/service/kms in github.com/aws/aws-sdk-go v1.51.2
go: found github.com/aws/aws-sdk-go/service/sts in github.com/aws/aws-sdk-go v1.51.2
go: found k8s.io/client-go/util/jsonpath in k8s.io/client-go v0.29.3
go: found github.com/docker/libkv in github.com/docker/libkv v0.2.1
go: found github.com/docker/libkv/store in github.com/docker/libkv v0.2.1
go: found github.com/docker/libkv/store/boltdb in github.com/docker/libkv v0.2.1
go: found github.com/docker/libkv/store/consul in github.com/docker/libkv v0.2.1
go: found github.com/hashicorp/consul/api in github.com/hashicorp/consul/api v1.28.2
go: found github.com/hashicorp/vault/api in github.com/hashicorp/vault/api v1.12.2
go: found golang.org/x/crypto/pbkdf2 in golang.org/x/crypto v0.21.0
go: github.com/hairyhenderson/gomplate imports
        github.com/hairyhenderson/gomplate/data imports
        github.com/hairyhenderson/toml: github.com/hairyhenderson/toml@v0.4.1: parsing go.mod:
        module declares its path as: github.com/BurntSushi/toml
                but was required as: github.com/hairyhenderson/toml

Any chance to get this resolved? Installing gomplate via go install or package manager as last resort would also be no problem. Appreciate your help and maintaining❤️

hairyhenderson commented 2 months ago

Hi @SolomonRosemite - this isn't a supported method of installing or running gomplate, so I'm not surprised it doesn't work...

If you want to compile it yourself, the supported method is:

go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@latest

(or substitute v4 for v3 if you want the v3 branch)

See the docs for further instructions on installing.

I'm going to close this now, but feel free to re-open if you're unable to install with the above methods!

SolomonRosemite commented 2 months ago

Hi, go install will do just fine. Thanks!