2019-06-12 22:54:15 +03:00
|
|
|
// Copyright 2019 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2021-01-08 20:59:44 +03:00
|
|
|
// Gopls (pronounced “go please”) is an LSP server for Go.
|
2019-06-12 22:54:15 +03:00
|
|
|
// The Language Server Protocol allows any text editor
|
|
|
|
// to be extended with IDE-like features;
|
|
|
|
// see https://langserver.org/ for details.
|
2020-01-30 23:20:19 +03:00
|
|
|
//
|
2021-01-08 20:59:44 +03:00
|
|
|
// See https://github.com/golang/tools/blob/master/gopls/README.md
|
|
|
|
// for the most up-to-date documentation.
|
2019-06-12 22:54:15 +03:00
|
|
|
package main // import "golang.org/x/tools/gopls"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
go/analysis/passes/tests: Check malformed fuzz target.
This will validate that first letter after FuzzFoo() should be uppercase
Also, following validation will be performed for f.Fuzz() calls :
1. f.Fuzz() should call a function and it should be of type (*testing.F).Fuzz().
2. The called function in f.Fuzz(func(){}) should not return result.
3. First argument of func() should be of type *testing.T
4. Second argument onwards should be of type []byte, string, bool, byte,
rune, float32, float64, int, int8, int16, int32, int64, uint, uint8, uint16,
uint32, uint64
For golang/go#50198
Change-Id: I540daf635f0fe03d954b010b9b5f8616fd5df47a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/374495
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Peter Weinberger <pjw@google.com>
2022-01-03 16:09:35 +03:00
|
|
|
"golang.org/x/tools/internal/analysisinternal"
|
2019-06-12 22:54:15 +03:00
|
|
|
"os"
|
|
|
|
|
2019-09-19 00:33:04 +03:00
|
|
|
"golang.org/x/tools/gopls/internal/hooks"
|
2019-06-12 22:54:15 +03:00
|
|
|
"golang.org/x/tools/internal/lsp/cmd"
|
|
|
|
"golang.org/x/tools/internal/tool"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
go/analysis/passes/tests: Check malformed fuzz target.
This will validate that first letter after FuzzFoo() should be uppercase
Also, following validation will be performed for f.Fuzz() calls :
1. f.Fuzz() should call a function and it should be of type (*testing.F).Fuzz().
2. The called function in f.Fuzz(func(){}) should not return result.
3. First argument of func() should be of type *testing.T
4. Second argument onwards should be of type []byte, string, bool, byte,
rune, float32, float64, int, int8, int16, int32, int64, uint, uint8, uint16,
uint32, uint64
For golang/go#50198
Change-Id: I540daf635f0fe03d954b010b9b5f8616fd5df47a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/374495
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Peter Weinberger <pjw@google.com>
2022-01-03 16:09:35 +03:00
|
|
|
// In 1.18, diagnostics for Fuzz tests must not be used by cmd/vet.
|
|
|
|
// So the code for Fuzz tests diagnostics is guarded behind flag analysisinternal.DiagnoseFuzzTests
|
|
|
|
// Turn on analysisinternal.DiagnoseFuzzTests for gopls
|
|
|
|
analysisinternal.DiagnoseFuzzTests = true
|
2019-09-19 00:33:04 +03:00
|
|
|
ctx := context.Background()
|
2019-10-11 03:48:16 +03:00
|
|
|
tool.Main(ctx, cmd.New("gopls", "", nil, hooks.Options), os.Args[1:])
|
2019-06-12 22:54:15 +03:00
|
|
|
}
|