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

feat(go): Dynamic snippets support exportedClientName #5380

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

amckinney
Copy link
Contributor

@amckinney amckinney commented Dec 10, 2024

This updates Go's dynamic snippet generator to respect the exportedClientName configuration. With this, the generated snippet references the correct constructor method like so:

# generators.yml
- name: fern-api/fern-go-sdk
  version: 0.33.0
  config:
    exportedClientName: FernClient
client := client.NewFernClient(
    option.WithToken(
        "<YOUR_API_KEY>",
    ),
)

Note that this also refactors the DynamicSnippetsGenerator and DRYs up a few things with the new EndpointSnippetGenerator and Result classes.

@amckinney amckinney requested a review from dsinghvi as a code owner December 10, 2024 21:20
@amckinney amckinney merged commit 0f85470 into main Dec 10, 2024
49 checks passed
@amckinney amckinney deleted the amckinney/go/dynamic-snippets branch December 10, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants