parameter 'srcInfo' seems to be unused, consider removing or renaming it as _
551
552// determineGuest returns the guest type to use for a new app.
553// Currently, it defaults to shared-cpu-1x
554func determineGuest(ctx context.Context, config *appconfig.Config, srcInfo *scanner.SourceInfo) (*api.MachineGuest, string, error) {555 def := helpers.Clone(api.MachinePresets["shared-cpu-1x"])
556 def.MemoryMB = 1024
557 reason := "most apps need about 1GB of RAM"
parameter 'config' seems to be unused, consider removing or renaming it as _
551
552// determineGuest returns the guest type to use for a new app.
553// Currently, it defaults to shared-cpu-1x
554func determineGuest(ctx context.Context, config *appconfig.Config, srcInfo *scanner.SourceInfo) (*api.MachineGuest, string, error) {555 def := helpers.Clone(api.MachinePresets["shared-cpu-1x"])
556 def.MemoryMB = 1024
557 reason := "most apps need about 1GB of RAM"
parameter 'paidPlan' seems to be unused, consider removing or renaming it as _
504// 1. the primary_region field of the config, if one exists
505// 2. the region specified on the command line, if specified
506// 3. the nearest region to the user
507func determineRegion(ctx context.Context, config *appconfig.Config, paidPlan bool) (*api.Region, string, error) {508
509 client := client.FromContext(ctx)
510 regionCode := flag.GetRegion(ctx)
Description
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
Bad practice
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
Recommended
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}