directive

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package directive provides utilities for processing ctxweaver directives in comments.

Index

Constants

View Source
const (
	MalformedMessage = "malformed ctxweaver directive: write it as //ctxweaver:name"
	UnknownMessage   = "unknown ctxweaver directive: ctxweaver:"
	SkipArgMessage   = "ctxweaver:skip takes no argument; write a reason after //"
	HiddenMessage    = "ctxweaver directive after another comment: write it as its own //ctxweaver:name comment"
)

Warning messages for a comment that Problem reports.

Variables

This section is empty.

Functions

func HasSkipDirective

func HasSkipDirective(decs *dst.NodeDecs) bool

HasSkipDirective checks if node decorations contain a skip directive. This is used for file-level and function-level skip directives.

func HasStmtSkipDirective

func HasStmtSkipDirective(stmt dst.Stmt) bool

HasStmtSkipDirective checks if a statement has a skip directive comment. Checks both Start (before) and End (trailing) decorations.

func Problem added in v0.11.0

func Problem(text string) string

Problem returns the warning for a comment addressed to ctxweaver that is not a directive ctxweaver reads, or "" for any other comment. Such a comment has no effect, and the caller must not rewrite the file holding it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址