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

Create godoc-friendly examples #268

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

aol-nnov
Copy link
Contributor

Move tests from the diskfs.go global comment section and update them as they are slightly out of date.

@deitch while trying to put my examples together I've found out that code snippets from the header comment block are slightly out of date.

I've converted them to the godoc-friendly versions and also left one FIXME item, as I'm not sure how it was intended to work here. Please advise how to fill gpt structures to match the comment above that example.

@aol-nnov
Copy link
Contributor Author

Also, i'd like to make lint checks more loose in examples, but as failing CI shows, totally disabling them is a bad idea..

@deitch
Copy link
Collaborator

deitch commented Nov 18, 2024

Looks like vet fails the examples. But I like this setup.

@aol-nnov
Copy link
Contributor Author

I'm out for today... Will try something in near future - tomorrow or may be on Wednesday...

If you have any ideas how to make linter have softer checks for examples, please let me know...

@aol-nnov
Copy link
Contributor Author

@deitch if you like those check() and unused(), there is one more action item left and then it's ready for merge.

@deitch
Copy link
Collaborator

deitch commented Nov 19, 2024

Yeah, it's nice.

@aol-nnov
Copy link
Contributor Author

Okay, and what about that last action item?

Should Start be 1*1024*1024/512 and Size be 10*1024*1024?

To be frank, for me, generally, it's a bit counter-intuitive, that Start is in sectors and Size is in bytes....

@deitch
Copy link
Collaborator

deitch commented Nov 19, 2024

Okay, and what about that last action item?

Oh, I missed that. Sure, those numbers are as good as anything else.

Move tests from the diskfs.go global comment section and
update them as they are slightly out of date.
@aol-nnov
Copy link
Contributor Author

aol-nnov commented Nov 19, 2024

Done.

I just wanted to make sure, those numbers match the description comment above the example.

@deitch deitch merged commit 15ebb7b into diskfs:master Nov 19, 2024
20 checks passed
@deitch
Copy link
Collaborator

deitch commented Nov 19, 2024

Thanks! Good to have you contributing here.

@aol-nnov aol-nnov deleted the update-examples branch November 19, 2024 19:20
@aol-nnov
Copy link
Contributor Author

Yay, updated docs have finally landed! https://pkg.go.dev/github.com/diskfs/go-diskfs@master

Pretty! 🎉

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