Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

simplify environment var with same format UPPERCASE and UNDERSCORE#663

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hungran wants to merge1 commit intogithub:main
base:main
Choose a base branch
Loading
fromhungran:hungran/simplify-env-var

Conversation

hungran
Copy link

Closes:

This enhance that all argument can be treat as environment variable with standard format from viperhttps://github.com/spf13/viper/blob/master/viper.go#L1400-L1403

eg: given argument flagdynamic-toolsets can use asGITHUB_DYNAMIC_TOOLSETS

Signed-off-by: hungran <26101787+hungran@users.noreply.github.com>
@CopilotCopilotAI review requested due to automatic review settingsJuly 11, 2025 06:39
@hungranhungran requested a review froma team as acode ownerJuly 11, 2025 06:39
@hungranhungran changed the titlesimplify environment var with same format UPPERCASE and UNDERSCORsimplify environment var with same format UPPERCASE and UNDERSCOREJul 11, 2025
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Enhance Viper configuration to allow flag names with hyphens to be consumed as environment variables by replacing hyphens with underscores.

  • Configure Viper to replace- with_ in env var keys.
  • Callviper.SetEnvKeyReplacer beforeviper.AutomaticEnv().
Comments suppressed due to low confidence (1)

cmd/github-mcp-server/main.go:96

  • Consider adding a unit test for initConfig to verify that environment variables with hyphens (e.g., 'dynamic-toolsets') are correctly mapped to underscore format (e.g., 'GITHUB_DYNAMIC_TOOLSETS').
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@hungran

[8]ページ先頭

©2009-2025 Movatter.jp