I want to embed a sub module directory in parent module, but golang remind me that pattern tpl/api_new/*: cannot embed file tpl/api_new/README.md: in different module
I know that I can delete go.mod & go.sum and then run "go mod init && go get -u" when the new project is generated.
The bottom is the file tree and the embed variable, is there anything others I can do to embed go.mod & go.sum? Thanks~
//go:embed tpl/api_new/*
var apiNew embed.FS
├─api_new
│ │ .editorconfig
│ │ .gitignore
│ │ generate.go
│ │ go.mod
│ │ go.sum
│ │ makefile
│ │ README.md
│ │
│ ├─cmd
│ │ └─app
│ │ main.go
│ │
│ ├─config
│ │ config-dev.toml
│ │ config-live.toml
│ │ config-local.toml
│ │ config-prod.toml
│ │ config-stress.toml
│ │ config-trunk.toml
│ │
│ └─internal
│ └─app
│ ├─http
│ │ │ server.go
│ │ │
│ │ └─example
│ │ hello.go
│ │
│ ├─lib
│ │ ├─err
│ │ │ codecommon.go
│ │ │ err.go
│ │ │
│ │ ├─pms
│ │ │ init.go
│ │ │
│ │ └─util
│ │ md5.go
│ │ url.go
│ │
│ ├─model
│ │ │ init.go
│ │ │
│ │ ├─grpc
│ │ │ ├─roomaggregation
│ │ │ │ aggregation.proto
│ │ │ │ base.go
│ │ │ │
│ │ │ ├─roombase
│ │ │ │ base.proto
│ │ │ │ roombase.go
│ │ │ │
│ │ │ └─roomlist
│ │ │ base.proto
│ │ │ icon.go
│ │ │
│ │ ├─hrpc
│ │ │ │ init.go
│ │ │ │
│ │ │ └─efs
│ │ │ efs.go
│ │ │ init.go
│ │ │ option.go
│ │ │
│ │ └─redis
│ │ ├─attachInfo
│ │ │ index.go
│ │ │
│ │ ├─outing
│ │ │ index.go
│ │ │
│ │ ├─roomcity
│ │ │ roomcity.go
│ │ │
│ │ └─roomjump
│ │ index.go
│ │
│ └─service
│ │ init.go
│ │
│ └─example
│ hello.go