Skip to content

Conversation

@inteon
Copy link

@inteon inteon commented Jan 12, 2026

In error messages, filesystems are often printed (eg.

return nil, fmt.Errorf("could not open repositories file in %s at %s: %w", a.fs, reposFilePath, err)
).

Without String function, this resulted in unreadable error messages:

Error: could not open repositories file in &{/ %!s(*fs.memFS=&{0xc000162000}) map[] {{} {%!s(int32=0) %!s(uint32=0)}}} at etc/apk/repositories: open /etc/apk/repositories: no such file or directory

This is the new error message:

Error: could not open repositories file in dirfs:/ at etc/apk/repositories: open /etc/apk/repositories: no such file or directory

}
}

func (m *memFS) String() string {
Copy link
Author

Choose a reason for hiding this comment

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

We could potentially add this function to the FullFS interface, but this would be a breaking change, WDYT?

In error messages, filesystems are often printed (eg. 'fmt.Errorf("could not open repositories file in %s", a.fs)'). Without String function, this resulted in unreadable error messages.

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
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.

1 participant