{"id":"9fb5f39ede54777a","repo":"docker/cli","slug":"invalid-size-q","errorCode":null,"errorMessage":"invalid size: %q","messagePattern":"invalid size: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"opts/opts.go","lineNumber":438,"sourceCode":"\tval, err := units.RAMInBytes(value)\n\t*m = MemBytes(val)\n\treturn err\n}\n\n// Type returns the type\nfunc (*MemBytes) Type() string {\n\treturn \"bytes\"\n}\n\n// Value returns the value in int64\nfunc (m *MemBytes) Value() int64 {\n\treturn int64(*m)\n}\n\n// UnmarshalJSON is the customized unmarshaler for MemBytes\nfunc (m *MemBytes) UnmarshalJSON(s []byte) error {\n\tif len(s) <= 2 || s[0] != '\"' || s[len(s)-1] != '\"' {\n\t\treturn fmt.Errorf(\"invalid size: %q\", s)\n\t}\n\tval, err := units.RAMInBytes(string(s[1 : len(s)-1]))\n\t*m = MemBytes(val)\n\treturn err\n}\n\n// MemSwapBytes is a type for human readable memory bytes (like 128M, 2g, etc).\n// It differs from MemBytes in that -1 is valid and the default.\ntype MemSwapBytes int64\n\n// Set sets the value of the MemSwapBytes by passing a string\nfunc (m *MemSwapBytes) Set(value string) error {\n\tif value == \"-1\" {\n\t\t*m = MemSwapBytes(-1)\n\t\treturn nil\n\t}\n\tval, err := units.RAMInBytes(value)\n\t*m = MemSwapBytes(val)","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/opts/opts.go#L420-L456","documentation":"Error \"invalid size: %q\" thrown in docker/cli.","triggerScenarios":"Thrown at opts/opts.go:438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}