| 1 | // Copyright 2025 The Go MCP SDK Authors. All rights reserved. |
| 2 | // Use of this source code is governed by an MIT-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package mcp |
| 6 | |
| 7 | import "time" |
| 8 | |
| 9 | // This file exports some helpers for mutating internals of the command |
| 10 | // transport for testing. |
| 11 | |
| 12 | // SetDefaultTerminateDuration sets the default command terminate duration, |
| 13 | // and returns a function to reset it to the default. |
| 14 | func SetDefaultTerminateDuration(d time.Duration) (reset func()) { |
| 15 | initial := defaultTerminateDuration |
| 16 | defaultTerminateDuration = d |
| 17 | return func() { |
| 18 | defaultTerminateDuration = initial |
| 19 | } |
| 20 | } |