mirror of
https://github.com/foomo/gocontemplate.git
synced 2025-10-16 12:35:36 +00:00
feat: expand env
This commit is contained in:
parent
59522235bc
commit
24aead8c3b
@ -2,6 +2,7 @@ package contemplate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
"golang.org/x/tools/go/packages"
|
||||
)
|
||||
@ -15,7 +16,7 @@ func Load(ctx context.Context, cfg *Config) (*Contemplate, error) {
|
||||
// load packages
|
||||
pkgs, err := packages.Load(&packages.Config{
|
||||
Context: ctx,
|
||||
Dir: cfg.Directory,
|
||||
Dir: os.ExpandEnv(cfg.Directory),
|
||||
Mode: packages.NeedName | packages.NeedTypesInfo |
|
||||
packages.NeedFiles | packages.NeedImports | packages.NeedDeps |
|
||||
packages.NeedModule | packages.NeedTypes | packages.NeedSyntax,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user