Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default annotation not working after v0.1.8 #9

Open
Stoakes opened this issue Mar 21, 2021 · 1 comment
Open

Default annotation not working after v0.1.8 #9

Stoakes opened this issue Mar 21, 2021 · 1 comment

Comments

@Stoakes
Copy link

Stoakes commented Mar 21, 2021

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 & link to CI

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 & link to CI

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.

@Stoakes Stoakes changed the title Default tag not working after v0.1.8 Default annotation not working after v0.1.8 Mar 21, 2021
@alecthomas
Copy link
Owner

Hi, sorry for the delay, I somehow missed this :(

Is this still occurring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants