An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 5.5% on proxy.golang.org

proxy.golang.org : golang.org/x/tools/go/expect

Package expect provides support for interpreting structured comments in Go source code (including go.mod and go.work files) as test expectations. [Note: there is an open proposal (golang/go#70229) to deprecate, tag, and delete this package. If accepted, the last version of the package be available indefinitely but will not receive updates.] This is primarily intended for writing tests of things that process Go source files, although it does not directly depend on the testing package. Collect notes with the Extract or Parse functions, and use the MatchBefore function to find matches within the lines the comments were on. The interpretation of the notes depends on the application. For example, the test suite for a static checking tool might use a @diag note to indicate an expected diagnostic: By contrast, the test suite for a source code navigation tool might use notes to indicate the positions of features of interest, the actions to be performed by the test, and their expected outcomes: Note comments always start with the special marker @, which must be the very first character after the comment opening pair, so //@ or /*@ with no spaces. This is followed by a comma separated list of notes. A note always starts with an identifier, which is optionally followed by an argument list. The argument list is surrounded with parentheses and contains a comma-separated list of arguments. The empty parameter list and the missing parameter list are distinguishable if needed; they result in a nil or an empty list in the Args parameter respectively. Arguments are either identifiers or literals. The literals supported are the basic value literals, of string, float, integer true, false or nil. All the literals match the standard go conventions, with all bases of integers, and both quote and backtick strings. There is one extra literal type, which is a string literal preceded by the identifier "re" which is compiled to a regular expression.

Registry - Homepage - Documentation - JSON - codemeta.json
purl: pkg:golang/golang.org/x/tools/go/expect
License: BSD-3-Clause
Latest release: 5 months ago
First release: 5 months ago
Namespace: golang.org/x/tools/go
Last synced: 19 days ago

    Loading...
    Readme
    Loading...