Skip to content

Commit

Permalink
chore: Update doc comments, coding style, fix lint
Browse files Browse the repository at this point in the history
* about error string: error string should not be capitalized or end with punctuation mark
* apply suggestions from code review
* lint: fix format error and simplify the code

Co-authored-by: Fraser Waters <frassle@gmail.com>
Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
  • Loading branch information
3 people committed Oct 13, 2022
1 parent cc881f6 commit 9922d06
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pulumi-language-dotnet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func DeterminePluginDependency(packageDir, packageName, packageVersion string) (
case os.IsNotExist(err):
break
case err != nil:
return nil, fmt.Errorf("Failed to read version file: %w", err)
return nil, fmt.Errorf("failed to read version file: %w", err)
}

defaultName := strings.ToLower(strings.TrimPrefix(packageName, "Pulumi."))
Expand Down Expand Up @@ -403,7 +403,7 @@ func DeterminePluginDependency(packageDir, packageName, packageVersion string) (

_, err = semver.ParseTolerant(version)
if err != nil {
return nil, fmt.Errorf("Invalid package version: %w", err)
return nil, fmt.Errorf("invalid package version: %w", err)
}

result := &pulumirpc.PluginDependency{
Expand Down Expand Up @@ -545,7 +545,7 @@ func (w *logWriter) LogToUser(val string) (int, error) {
return len(val), nil
}

// RPC endpoint for LanguageRuntimeServer::Run
// Run is the RPC endpoint for LanguageRuntimeServer::Run
func (host *dotnetLanguageHost) Run(ctx context.Context, req *pulumirpc.RunRequest) (*pulumirpc.RunResponse, error) {
config, err := host.constructConfig(req)
if err != nil {
Expand Down Expand Up @@ -769,7 +769,7 @@ func (host *dotnetLanguageHost) GetProgramDependencies(
}
cmd := exec.Command(ex, cmdArgs...)
if out, err = cmd.Output(); err != nil {
return nil, fmt.Errorf("Failed to call \"%s\": %w", ex, err)
return nil, fmt.Errorf("failed to call \"%s\": %w", ex, err)
}
lines := strings.Split(strings.ReplaceAll(string(out), "\r\n", "\n"), "\n")
var packages []*pulumirpc.DependencyInfo
Expand All @@ -793,7 +793,7 @@ func (host *dotnetLanguageHost) GetProgramDependencies(
// Transitive package => name version
version = 1
} else {
return nil, fmt.Errorf("Failed to parse \"%s\"", p)
return nil, fmt.Errorf("failed to parse \"%s\"", p)
}
packages = append(packages, &pulumirpc.DependencyInfo{
Name: nameRequiredVersion[0],
Expand Down

0 comments on commit 9922d06

Please sign in to comment.