Skip to content

envvar_test TestConfiguration_Get questions #80

Answered by MarioCarrion
wcwynn asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @wcwynn!

So the answer to all your 3 questions: when creating tests that involve leaving some sort of state I like restoring that to the original system value; however you're right I should have used os.LookupEnv instead.

With that being said, I'm glad you reached out because what I did right here does not make sense anymore if Go 1.17 is being used, so I updated the code to use the new t.Setenv method, take a look when you have some free time, I think it's cleaner this way.

Best!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wcwynn
Comment options

@MarioCarrion
Comment options

Answer selected by MarioCarrion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #79 on January 07, 2022 23:27.