{"record":{"id":"7601a502b2042923","repo":"go-delve/delve","slug":"substitutepath-requires-both-from-and-to-ent","errorCode":null,"errorMessage":"'substitutePath' requires both 'from' and 'to' entries","messagePattern":"'substitutePath' requires both 'from' and 'to' entries","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/types.go","lineNumber":260,"sourceCode":"\tTo string `json:\"to,omitempty\"`\n}\n\nfunc (m *SubstitutePath) UnmarshalJSON(data []byte) error {\n\t// use custom unmarshal to check if both from/to are set.\n\ttype tmpType struct {\n\t\tFrom *string\n\t\tTo   *string\n\t}\n\tvar tmp tmpType\n\n\tif err := json.Unmarshal(data, &tmp); err != nil {\n\t\tif _, ok := err.(*json.UnmarshalTypeError); ok {\n\t\t\treturn fmt.Errorf(`cannot use %s as 'substitutePath' of type {\"from\":string, \"to\":string}`, data)\n\t\t}\n\t\treturn err\n\t}\n\tif tmp.From == nil || tmp.To == nil {\n\t\treturn errors.New(\"'substitutePath' requires both 'from' and 'to' entries\")\n\t}\n\t*m = SubstitutePath{*tmp.From, *tmp.To}\n\treturn nil\n}\n\n// AttachConfig is the collection of attach request attributes recognized by DAP implementation.\n// 'processId' and 'waitFor' are mutually exclusive, and can't be specified at the same time.\ntype AttachConfig struct {\n\t// Acceptable values are:\n\t//   \"local\": attaches to the local process with the given ProcessID.\n\t//   \"remote\": expects the debugger to already be running to \"attach\" to an in-progress debug session.\n\t//\n\t// Default is \"local\".\n\tMode string `json:\"mode\"`\n\n\t// The numeric ID of the process to be debugged.\n\tProcessID int `json:\"processId,omitempty\"`\n","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/types.go#L242-L278","documentation":"Error \"'substitutePath' requires both 'from' and 'to' entries\" thrown in go-delve/delve.","triggerScenarios":"Thrown at service/dap/types.go:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}