go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.07k stars 1.29k forks source link

Import problem (Validator V10 / Go 1.22 / VS Code) #1229

Open emirefek opened 4 months ago

emirefek commented 4 months ago

Package version eg. v9, v10:

v10

Issue, Question or Enhancement:

Cannot import V10 with VSCode uses official GOLang plugin.

Code sample, to showcase or reproduce:

PS C:\Users\emirefek\Desktop\go-mailer\dto> go get github.com/go-playground/validator/v10
go: added github.com/gabriel-vasile/mimetype v1.4.3
go: added github.com/go-playground/locales v0.14.1
go: added github.com/go-playground/universal-translator v0.18.1
go: added github.com/go-playground/validator/v10 v10.18.0
go: added github.com/leodido/go-urn v1.4.0
package dto

import "github.com/go-playground/validator/v10"

type SomePayload struct {
    Title   string
    Content string
}

func (payload SomePayload) Validate() error {

}
image image
deankarn commented 4 months ago

@emirefek I would file a bug with the official Golang plugin and/or VSCode.

I haven't used VSCode for a few years now but know for a fact it shouldn't be an issue with validator itself as I import the latest version in several projects that use Go 1.22 without issue.

from the information provided I also cannot see any reason why it's complaining in this way.

eduardo-mior commented 2 weeks ago

run go mod tidy and try again