Skip to content

go: use path.Join() over fmt.Sprintf()#432

Merged
florianl merged 3 commits intomainfrom
path-joins
Apr 7, 2025
Merged

go: use path.Join() over fmt.Sprintf()#432
florianl merged 3 commits intomainfrom
path-joins

Conversation

@florianl
Copy link
Copy Markdown
Member

@florianl florianl commented Apr 7, 2025

Currently the agent produces log lines that contains paths like this:

/proc/52627/root//usr/sbin/runc

Use path.Join() to avoid double // in paths.

Currently the agent produces log lines that contains paths like this:

/proc/52627/root//usr/sbin/runc

Use path.Join() to avoid double // in paths.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@florianl florianl requested review from a team as code owners April 7, 2025 12:06
Copy link
Copy Markdown
Contributor

@fabled fabled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with question on the path component string style to use if the slashes should be there or not? My personal preference is slightly on not including the slash unless needed. Thoughts?
Approving in any case.

Comment thread interpreter/apmint/socket.go Outdated
florianl and others added 2 commits April 7, 2025 17:15
Co-authored-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Comment thread process/process.go Outdated
Comment thread process/process.go Outdated
@florianl florianl merged commit efa9857 into main Apr 7, 2025
26 checks passed
@florianl florianl deleted the path-joins branch April 7, 2025 15:56
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.

3 participants