-
Notifications
You must be signed in to change notification settings - Fork 266
chore: remove dead String/IsValid methods from constants (batch 9) #18818
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| package constants | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "path/filepath" | ||
| "time" | ||
| ) | ||
|
|
@@ -34,16 +33,6 @@ const CLIExtensionPrefix CommandPrefix = "gh aw" | |
| // } | ||
| type LineLength int | ||
|
|
||
|
Comment on lines
34
to
35
|
||
| // String returns the string representation of the line length | ||
| func (l LineLength) String() string { | ||
| return fmt.Sprintf("%d", l) | ||
| } | ||
|
|
||
| // IsValid returns true if the line length is positive | ||
| func (l LineLength) IsValid() bool { | ||
| return l > 0 | ||
| } | ||
|
|
||
| // Version represents a software version string. | ||
| // This semantic type distinguishes version strings from arbitrary strings, | ||
| // enabling future validation logic (e.g., semver parsing) and making | ||
|
|
@@ -75,16 +64,6 @@ func (v Version) IsValid() bool { | |
| // func IsFeatureEnabled(flag FeatureFlag) bool { ... } | ||
| type FeatureFlag string | ||
|
|
||
| // String returns the string representation of the feature flag | ||
| func (f FeatureFlag) String() string { | ||
| return string(f) | ||
| } | ||
|
|
||
| // IsValid returns true if the feature flag is non-empty | ||
| func (f FeatureFlag) IsValid() bool { | ||
| return len(f) > 0 | ||
| } | ||
|
|
||
| // URL represents a URL string. | ||
| // This semantic type distinguishes URLs from arbitrary strings, | ||
| // making URL parameters explicit and enabling future validation logic. | ||
|
|
@@ -95,16 +74,6 @@ func (f FeatureFlag) IsValid() bool { | |
| // func FetchFromRegistry(url URL) error { ... } | ||
| type URL string | ||
|
|
||
| // String returns the string representation of the URL | ||
| func (u URL) String() string { | ||
| return string(u) | ||
| } | ||
|
|
||
| // IsValid returns true if the URL is non-empty | ||
| func (u URL) IsValid() bool { | ||
| return len(u) > 0 | ||
| } | ||
|
|
||
| // ModelName represents an AI model name identifier. | ||
| // This semantic type distinguishes model names from arbitrary strings, | ||
| // making model selection explicit in function signatures. | ||
|
|
@@ -115,16 +84,6 @@ func (u URL) IsValid() bool { | |
| // func ExecuteWithModel(model ModelName) error { ... } | ||
| type ModelName string | ||
|
|
||
| // String returns the string representation of the model name | ||
| func (m ModelName) String() string { | ||
| return string(m) | ||
| } | ||
|
|
||
| // IsValid returns true if the model name is non-empty | ||
| func (m ModelName) IsValid() bool { | ||
| return len(m) > 0 | ||
| } | ||
|
|
||
| // JobName represents a GitHub Actions job identifier. | ||
| // This semantic type distinguishes job names from arbitrary strings, | ||
| // preventing mixing of job identifiers with other string types. | ||
|
|
@@ -195,16 +154,6 @@ func (c CommandPrefix) IsValid() bool { | |
| // func CompileWorkflow(id WorkflowID) error { ... } | ||
| type WorkflowID string | ||
|
|
||
| // String returns the string representation of the workflow ID | ||
| func (w WorkflowID) String() string { | ||
| return string(w) | ||
| } | ||
|
|
||
| // IsValid returns true if the workflow ID is non-empty | ||
| func (w WorkflowID) IsValid() bool { | ||
| return len(w) > 0 | ||
| } | ||
|
|
||
| // EngineName represents an AI engine name identifier (copilot, claude, codex, custom). | ||
| // This semantic type distinguishes engine names from arbitrary strings, | ||
| // making engine selection explicit and type-safe. | ||
|
|
@@ -215,16 +164,6 @@ func (w WorkflowID) IsValid() bool { | |
| // func SetEngine(engine EngineName) error { ... } | ||
| type EngineName string | ||
|
|
||
| // String returns the string representation of the engine name | ||
| func (e EngineName) String() string { | ||
| return string(e) | ||
| } | ||
|
|
||
| // IsValid returns true if the engine name is non-empty | ||
| func (e EngineName) IsValid() bool { | ||
| return len(e) > 0 | ||
| } | ||
|
|
||
| // DocURL represents a documentation URL for error messages and help text. | ||
| // This semantic type distinguishes documentation URLs from arbitrary URLs, | ||
| // making documentation references explicit and centralized for easier maintenance. | ||
|
|
@@ -666,11 +605,6 @@ func (m MCPServerID) String() string { | |
| return string(m) | ||
| } | ||
|
|
||
| // IsValid returns true if the MCP server ID is non-empty | ||
| func (m MCPServerID) IsValid() bool { | ||
| return len(m) > 0 | ||
| } | ||
|
|
||
| // SafeOutputsMCPServerID is the identifier for the safe-outputs MCP server | ||
| const SafeOutputsMCPServerID MCPServerID = "safeoutputs" | ||
|
|
||
|
|
||
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.
scratchpad/go-type-patterns.mdincludes code examples forLineLength,WorkflowID, andEngineNamethat still reference the deletedString()/IsValid()methods (see e.g. scratchpad/go-type-patterns.md around the “LineLength Type” / “WorkflowID Type” sections). Since this PR removes those methods, the documentation examples should be updated to avoid showing non-compiling code.