Skip to content

cmd/vet: printf check misses strings that are + together #30436

Closed
@imirkin

Description

@imirkin

With this example put into https://play.golang.org/ (and go1.11), there is no warning. Joining the two strings into 1 results in a warning.

package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello, playground %d" + "", 5)
}

Some people split long strings, which is where I encountered it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions