“respError”: “json: unsupported type: func() (io.ReadCloser, error)”
zap library in Golang hit the error on logging a field of the function type.
{"level":"info","msg":"non-200 response","respError":"json: unsupported type: func() (io.ReadCloser, error)"}
The problem is with the type of logger used.
Source code for the above log is:
package mainimport (
"fmt"
"go.uber.org/zap"
"log"
"net/http"
"net/http/httptest"
)func main() {
const body = "Go is…