alecthomas / alecthomas/hcl

Default annotation not working after v0.1.8

Aperta
#9 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
53
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello,

To begin with, thanks for your work on this package. It's great you have comment & time.Duration support !

I tried to use it as a replacement of `hashicorp/hcl` in one of my project. But based on my unit tests, `default` annotation (such as `hcl:"connection_string" default:"postgresql://user:password@localhost:5432/postgres"`) stopped working between v0.1.8 & v0.1.9.

When using `v0.1.8` of this package, tests are successful, default values are correctly set. [link to PR](https://github.com/Stoakes/go-pkg/pull/3/files) & [link to CI](https://github.com/Stoakes/go-pkg/pull/3/checks?check_run_id=2161148701)
```
github.com/Stoakes/go-pkg/config [no test files]
=== RUN Test_FileExportCommand
--- PASS: Test_FileExportCommand (0.00s)
PASS
coverage: 86.1% of statements
ok github.com/Stoakes/go-pkg/config/cmd 0.004s coverage: 86.1% of statements
```

When using v0.1.9 or higher, tests fails, default values aren't set anymore. [link to PR](https://github.com/Stoakes/go-pkg/pull/2/files) & [link to CI](https://github.com/Stoakes/go-pkg/actions/runs/673294835)

```
github.com/Stoakes/go-pkg/config [no test files]
=== RUN Test_FileExportCommand
builder_test.go:115: hcl test error. Expected "mode = false

Local {
connection_string = "***localhost:5432/postgres"
}

remote {
address = ""
useTLS = false
}
" got "Local {
}

remote {
address = ""
}
"
--- FAIL: Test_FileExportCommand (0.00s)
FAIL
coverage: 86.1% of statements
FAIL github.com/Stoakes/go-pkg/config/cmd 0.005s
FAIL
```
Tell me if I can help.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.