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

[Feature] Use functional option pattern for constructor #6

Open
KEINOS opened this issue Jul 30, 2023 · 0 comments
Open

[Feature] Use functional option pattern for constructor #6

KEINOS opened this issue Jul 30, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@KEINOS
Copy link
Owner

KEINOS commented Jul 30, 2023

  • Before

    obj := gisty.NewGisty()
    
    args := gisty.ListArgs{
      Limit:      10,
      OnlyPublic: true,  // If both OnlyPublic and OnlySecret are true,
      OnlySecret: false, // OnlySecret is prior.
    }
    
    items, err := obj.List(args)
  • After

    obj := gisty.NewGisty(
      gisty.WithLimit(10),
      gisty.WithOnlySecret(true),
    )
    
    items, err := obj.List(
      gisty.WithOnlySecret(false), 
    )
@KEINOS KEINOS added the enhancement New feature or request label Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant