Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for structtag (0.12 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go

    )
    
    const Doc = `check that struct field tags conform to reflect.StructTag.Get
    
    Also report certain struct tags (json, xml) used with unexported fields.`
    
    var Analyzer = &analysis.Analyzer{
    	Name:             "structtag",
    	Doc:              Doc,
    	URL:              "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/structtag",
    	Requires:         []*analysis.Analyzer{inspect.Analyzer},
    	RunDespiteErrors: true,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 8.8K bytes
    - Viewed (0)
  2. src/cmd/vet/testdata/structtag/structtag.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file contains the test for canonical struct tags.
    
    package structtag
    
    type StructTagTest struct {
    	A int "hello" // ERROR "`hello` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 20 15:46:42 UTC 2019
    - 376 bytes
    - Viewed (0)
  3. schema/utils.go

    		}
    	}
    	return
    }
    
    func removeSettingFromTag(tag reflect.StructTag, names ...string) reflect.StructTag {
    	for _, name := range names {
    		tag = reflect.StructTag(regexp.MustCompile(`(?i)(gorm:.*?)(`+name+`(:.*?)?)(;|("))`).ReplaceAllString(string(tag), "${1}${5}"))
    	}
    	return tag
    }
    
    func appendSettingFromTag(tag reflect.StructTag, value string) reflect.StructTag {
    	t := tag.Get("gorm")
    	if strings.Contains(t, value) {
    		return tag
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  4. schema/utils_test.go

    	}
    
    	for k, v := range tags {
    		if string(removeSettingFromTag(reflect.StructTag(k), "column")) != v {
    			t.Errorf("%v after removeSettingFromTag should equal %v, but got %v", k, v, removeSettingFromTag(reflect.StructTag(k), "column"))
    		}
    	}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Jul 31 10:19:25 UTC 2020
    - 1.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go

    type Unmarshaler interface {
    	UnmarshalQueryParameter(string) error
    }
    
    func jsonTag(field reflect.StructField) (string, bool) {
    	structTag := field.Tag.Get("json")
    	if len(structTag) == 0 {
    		return "", false
    	}
    	parts := strings.Split(structTag, ",")
    	tag := parts[0]
    	if tag == "-" {
    		tag = ""
    	}
    	omitempty := false
    	parts = parts[1:]
    	for _, part := range parts {
    		if part == "omitempty" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  6. src/cmd/vet/main.go

    	"golang.org/x/tools/go/analysis/passes/stdmethods"
    	"golang.org/x/tools/go/analysis/passes/stdversion"
    	"golang.org/x/tools/go/analysis/passes/stringintconv"
    	"golang.org/x/tools/go/analysis/passes/structtag"
    	"golang.org/x/tools/go/analysis/passes/testinggoroutine"
    	"golang.org/x/tools/go/analysis/passes/tests"
    	"golang.org/x/tools/go/analysis/passes/timeformat"
    	"golang.org/x/tools/go/analysis/passes/unmarshal"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  7. src/cmd/vet/doc.go

    	slog             check for invalid structured logging calls
    	stdmethods       check signature of methods of well-known interfaces
    	stringintconv    check for string(int) conversions
    	structtag        check that struct field tags conform to reflect.StructTag.Get
    	testinggoroutine report calls to (*testing.T).Fatal from goroutines started by a test
    	tests            check for common mistaken usages of tests and examples
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 00:17:30 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  8. src/cmd/go/internal/test/flagdefs.go

    	"rangeloops":       true,
    	"shift":            true,
    	"sigchanyzer":      true,
    	"slog":             true,
    	"stdmethods":       true,
    	"stdversion":       true,
    	"stringintconv":    true,
    	"structtag":        true,
    	"testinggoroutine": true,
    	"tests":            true,
    	"timeformat":       true,
    	"unmarshal":        true,
    	"unreachable":      true,
    	"unsafeptr":        true,
    	"unusedresult":     true,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 01:02:40 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  9. src/cmd/internal/test2json/testdata/vet.test

            vet_test.go:114: files: ["testdata/bool.go" "testdata/method.go" "testdata/unused.go"]
        --- PASS: TestVet/0 (0.13s)
            vet_test.go:114: files: ["testdata/assign.go" "testdata/httpresponse.go" "testdata/structtag.go"]
        --- PASS: TestVet/4 (0.16s)
            vet_test.go:114: files: ["testdata/copylock.go" "testdata/print.go"]
        --- PASS: TestVet/1 (0.07s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 01 16:13:47 UTC 2020
    - 3.1K bytes
    - Viewed (0)
  10. src/cmd/internal/test2json/testdata/smiley.test

            vet_test.go:114: φιλεσ: ["testdata/bool.go" "testdata/method.go" "testdata/unused.go"]
        --- PASS: Test☺☹/0 (0.13s)
            vet_test.go:114: φιλεσ: ["testdata/assign.go" "testdata/httpresponse.go" "testdata/structtag.go"]
        --- PASS: Test☺☹/4 (0.16s)
            vet_test.go:114: φιλεσ: ["testdata/copylock.go" "testdata/print.go"]
        --- PASS: Test☺☹/1 (0.07s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 01 16:13:47 UTC 2020
    - 3.3K bytes
    - Viewed (0)
Back to top