Skip to content

Instantly share code, notes, and snippets.

View mabhi's full-sized avatar

Abhijit Mukherjee mabhi

  • Infracloud Technologies, pvt. ltd
  • Kolkata, India
View GitHub Profile
@mabhi
mabhi / gist:3c0460db11035d65d881a18f0aa26789
Created June 6, 2024 07:04
Check log message for a string
/*
Ex. output
{"File":"xyx.xyz/../../../some.go","Function":"xyz.xyz/../../package.FunctionName,"Line":36,"level":"error","msg":"Unsupported base image","time":"2024-06-06T12:29:40.032+0530"}
*/
func checkInvalidImage(c *qt.C, imageName, expected string) {
// Capture stderr via a pipe
stdErrC := make(chan *bytes.Buffer)
pR, pW, err := os.Pipe()
c.Assert(err, qt.IsNil)
go func() {