-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(go): Dynamic snippets support option.WithBaseURL
- Loading branch information
Showing
12 changed files
with
442 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...2/dynamic-snippets/src/__test__/__snapshots__/single-url-environment-default.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`single-url-environment-default > custom baseURL 1`] = ` | ||
"package example | ||
import ( | ||
context "context" | ||
client "github.com/acme/acme-go/client" | ||
option "github.com/acme/acme-go/option" | ||
) | ||
func do() { | ||
client := client.NewClient( | ||
option.WithBaseURL( | ||
"http://localhost:8080", | ||
), | ||
option.WithToken( | ||
"<YOUR_API_KEY>", | ||
), | ||
) | ||
client.Dummy.GetDummy( | ||
context.TODO(), | ||
) | ||
} | ||
" | ||
`; | ||
|
||
exports[`single-url-environment-default > invalid baseURL and environment 1`] = ` | ||
[ | ||
{ | ||
"message": "Cannot specify both baseUrl and environment options", | ||
"path": [], | ||
"severity": "CRITICAL", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`single-url-environment-default > invalid environment 1`] = ` | ||
[ | ||
{ | ||
"message": "Environment "Unrecognized" was not found", | ||
"path": [], | ||
"severity": "WARNING", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`single-url-environment-default > production environment 1`] = ` | ||
"package example | ||
import ( | ||
context "context" | ||
acme "github.com/acme/acme-go" | ||
client "github.com/acme/acme-go/client" | ||
option "github.com/acme/acme-go/option" | ||
) | ||
func do() { | ||
client := client.NewClient( | ||
option.WithBaseURL( | ||
acme.Environments.Production, | ||
), | ||
option.WithToken( | ||
"<YOUR_API_KEY>", | ||
), | ||
) | ||
client.Dummy.GetDummy( | ||
context.TODO(), | ||
) | ||
} | ||
" | ||
`; | ||
|
||
exports[`single-url-environment-default > staging environment 1`] = ` | ||
"package example | ||
import ( | ||
context "context" | ||
acme "github.com/acme/acme-go" | ||
client "github.com/acme/acme-go/client" | ||
option "github.com/acme/acme-go/option" | ||
) | ||
func do() { | ||
client := client.NewClient( | ||
option.WithBaseURL( | ||
acme.Environments.Staging, | ||
), | ||
option.WithToken( | ||
"<YOUR_API_KEY>", | ||
), | ||
) | ||
client.Dummy.GetDummy( | ||
context.TODO(), | ||
) | ||
} | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.