package main import ( "io" "gopkg.in/kataras/iris.v6" "gopkg.in/kataras/iris.v6/adaptors/httprouter" ) func main() { app := iris.New() // output startup banner and error logs on os.Stdout app.Adapt(iris.DevLogger()) // set the router, you can choose gorillamux too app.Adapt(httprouter.New()) // Custom Render Policy to override or create new content-type render // i,e: "text/html" with a prefix, // we will just write to the writer and return false // to continue to the next contentType-matched renderer if any. app.Adapt(iris.RenderPolicy(func(out io.Writer, contentType string, binding interface{}, options ...map[string]interface{}) (bool, error) { if contentType == "text/html" { if content, ok := binding.(string); ok { out.Write([]byte("
My Custom prefix