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

Add proof of concept for T.Output() #1

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

suntala
Copy link
Owner

@suntala suntala commented Sep 26, 2023

return OutputWriter{c}
}

type OutputWriter struct {
Copy link

Choose a reason for hiding this comment

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

unexport

parent.mu.Lock()
defer parent.mu.Unlock()
if !parent.done {
parent.output = append(parent.output, parent.decorate(str, depth+1)...)
Copy link

Choose a reason for hiding this comment

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

This Write method is at a lower level than logDepth. It isn't responsible for adding line info or a final newline, so it shouldn't call decorate. It does need to handle indentation, though. I'm not sure where that happens.

Co-authored-by: Aleks Fazlieva <[email protected]>
Co-authored-by: Aleks Fazlieva <[email protected]>
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.

2 participants