-
Notifications
You must be signed in to change notification settings - Fork 4
Add examples #12
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
Add examples #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds two new examples that demonstrate how to use Azure App Configuration—one for a console application and one for a Gin web application. Key changes include:
- A console example (main.go and README) that loads configuration and displays it in a terminal.
- A Gin web example (main.go and README) that configures routing and HTML rendering based on configuration values.
Reviewed Changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| example/console-example/main.go | Adds a console app that loads and displays configuration. |
| example/console-example/README.md | Provides usage instructions for the console example. |
| example/gin-example/main.go | Adds a Gin web app that loads configuration and configures routing. |
| example/gin-example/README.md | Provides usage instructions for the Gin example. |
Files not reviewed (4)
- example/console-example/go.mod: Language not supported
- example/gin-example/go.mod: Language not supported
- example/gin-example/templates/about.html: Language not supported
- example/gin-example/templates/index.html: Language not supported
.github/workflows/ci.yaml
Outdated
| security-scan: | ||
| name: Security Scan | ||
| runs-on: ubuntu-latest | ||
| env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason of explicitly setting it to on? According to the doc, it's default value is on
example/console-example/README.md
Outdated
| ## Configuration Structure | ||
|
|
||
| The example uses a nested configuration structure: | ||
|
|
||
| ```go | ||
| type Config struct { | ||
| Font Font | ||
| Message string | ||
| } | ||
|
|
||
| type Font struct { | ||
| Color string | ||
| Size int | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part feels a bit odd, it doesn’t seem necessary to specifically emphasize which struct we’re using here. How about just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of this README is focused on explaining how to run the example rather than explaining the example itself. We already explain what's done in this example, no need to emphasize the struct.
example/gin-example/main.go
Outdated
|
|
||
| // Parse configuration into struct | ||
| var config Config | ||
| constructOptions := azureappconfiguration.ConstructionOptions{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is ., how about using the default value instead?
example/gin-example/README.md
Outdated
| ## Configuration Structure | ||
|
|
||
| The example uses a nested configuration structure: | ||
|
|
||
| ```go | ||
| type Config struct { | ||
| App App | ||
| Message string | ||
| } | ||
|
|
||
| type App struct { | ||
| Name string | ||
| DebugMode bool | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, how about to remove this section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
No description provided.