Skip to content

Conversation

@mcpherrinm
Copy link
Contributor

@mcpherrinm mcpherrinm commented Apr 19, 2023

This moves command() from cmd/ into core.Command() and uses it from the log and main package, ensuring we have a single implementation of path.Base(os.Args[0]) instead of scattering that method around. I put it in core/util.go as similar enough functions like the BuildID and revision info already live there, though I am not entirely sure it's the right place.

This came up in @aarongable's review of #6750, where he pointed out I was manually hardcoding commands instead of using command() or similar.

This moves command() from cmd/ into core.Command() and uses it from the
log and main package, ensuring we have a single implementation of
path.Base(os.Args[0]) instead of scattering that method around.
@mcpherrinm mcpherrinm requested a review from a team as a code owner April 19, 2023 17:39
@mcpherrinm mcpherrinm requested a review from jsha April 19, 2023 17:39
jsha
jsha previously approved these changes Apr 21, 2023
@jsha jsha requested a review from a team April 21, 2023 03:45
@mcpherrinm
Copy link
Contributor Author

I did end up using command() in #6750 so I'm going to mark this PR as a draft again, until that merges to main and I can update this PR

@mcpherrinm mcpherrinm marked this pull request as draft April 21, 2023 16:14
@aarongable
Copy link
Contributor

#6750 has been merged

@mcpherrinm mcpherrinm marked this pull request as ready for review April 21, 2023 19:11
@mcpherrinm
Copy link
Contributor Author

Merged and updated this PR, so it's good to go now.

@pgporada pgporada merged commit 3502e4a into letsencrypt:main Apr 21, 2023
@mcpherrinm mcpherrinm deleted the mattm-logger-command-hygiene branch May 13, 2023 02:45
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

Successfully merging this pull request may close these issues.

4 participants