Skip to content

Commit afdba84

Browse files
committed
docs: Add warning about modifying GlobalState in Constructor documentation
1 parent 6d85c9a commit afdba84

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subcommand/extension.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import (
1515
// It receives a GlobalState instance that provides access to configuration, logging,
1616
// file system, and other shared k6 runtime state. The returned Command will be
1717
// integrated into k6's CLI as a subcommand.
18+
//
19+
// WARNING: The GlobalState parameter is read-only and must not be modified or altered
20+
// in any way. Modifying the GlobalState can make k6 core unstable and lead to
21+
// unpredictable behavior.
1822
type Constructor func(*state.GlobalState) *cobra.Command
1923

2024
// RegisterExtension registers a subcommand extension with the given name and constructor function.

0 commit comments

Comments
 (0)