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

Document go code snippets as examples #495

Merged
merged 18 commits into from
Aug 28, 2023

Conversation

smallhive
Copy link
Contributor

closes #204

@smallhive smallhive marked this pull request as ready for review August 17, 2023 11:15
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

It'd be great to make our examples more useful. Calling one function doesn't help, examples should show how things interact within the SDK to achieve some end-user goal, what are the prerequisites for some actions and how to properly process results of some calls.

accounting/doc.go Outdated Show resolved Hide resolved
accounting/doc.go Outdated Show resolved Hide resolved
accounting/example_test.go Outdated Show resolved Hide resolved
accounting/example_test.go Outdated Show resolved Hide resolved
accounting/example_test.go Outdated Show resolved Hide resolved
pool/example_test.go Outdated Show resolved Hide resolved
session/example_test.go Outdated Show resolved Hide resolved
session/example_test.go Outdated Show resolved Hide resolved
version/example_test.go Outdated Show resolved Hide resolved
version/example_test.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from 9a7cf84 to 2d3b2b2 Compare August 22, 2023 06:19
accounting/example_test.go Outdated Show resolved Hide resolved
audit/example_test.go Outdated Show resolved Hide resolved
audit/example_test.go Outdated Show resolved Hide resolved
client/example_container_put_test.go Show resolved Hide resolved
client/example_test.go Outdated Show resolved Hide resolved
pool/example_pool_test.go Show resolved Hide resolved
pool/example_test.go Outdated Show resolved Hide resolved
pool/example_test.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from 2d3b2b2 to 250b7fd Compare August 23, 2023 07:11
pool/example_test.go Outdated Show resolved Hide resolved
pool/example_test.go Outdated Show resolved Hide resolved
pool/example_test.go Outdated Show resolved Hide resolved
pool/example_test.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from 250b7fd to 207fa87 Compare August 24, 2023 04:27
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from 207fa87 to c512d8d Compare August 25, 2023 04:46
Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

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

  1. 8e83055: "Example with RCP..."
  2. Most of the commits are "remove" but in fact they are "move". But that is cosmetic
  3. Really often saw // send msg, // fill container but it should be // *send msg* instead. Not to confuse a reader, IMO

audit/example_test.go Outdated Show resolved Hide resolved
bearer/example_test.go Show resolved Hide resolved
checksum/example_test.go Outdated Show resolved Hide resolved
checksum/example_test.go Outdated Show resolved Hide resolved
container/example_test.go Outdated Show resolved Hide resolved
container/example_test.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from c512d8d to 439a485 Compare August 25, 2023 10:58
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from 439a485 to 806a9d9 Compare August 25, 2023 11:16
Example with RPC left in the code, because it can't be properly represented with examples.

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
@smallhive smallhive force-pushed the 204-document-go-code-snippets-as-examples branch from 806a9d9 to 5d5544e Compare August 28, 2023 03:50
@roman-khimov roman-khimov merged commit 40ac89d into master Aug 28, 2023
5 checks passed
@roman-khimov roman-khimov deleted the 204-document-go-code-snippets-as-examples branch August 28, 2023 10:43
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.

Document go code snippets as examples
3 participants