mirror of
https://github.com/kataras/iris.git
synced 2026-01-04 10:47:20 +00:00
formatting
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
@@ -74,5 +74,4 @@ func TestContentNegotiation(t *testing.T) {
|
||||
if expected, got := expectedHTMLResponse, string(rawResponse); expected != got {
|
||||
t.Fatalf("expected response to be:\n%s but got:\n%s", expected, got)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,14 +14,13 @@ import (
|
||||
// Read more at https://github.com/shiyanhui/hero/hero
|
||||
|
||||
func main() {
|
||||
|
||||
app := iris.New()
|
||||
|
||||
app.Get("/users", func(ctx iris.Context) {
|
||||
ctx.Gzip(true)
|
||||
ctx.ContentType("text/html")
|
||||
|
||||
var userList = []string{
|
||||
userList := []string{
|
||||
"Alice",
|
||||
"Bob",
|
||||
"Tom",
|
||||
|
||||
@@ -37,5 +37,4 @@ func UserList(userList []string, buffer *bytes.Buffer) {
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
|
||||
}
|
||||
|
||||
@@ -40,5 +40,4 @@ func UserListToWriter(userList []string, w io.Writer) (int, error) {
|
||||
</html>
|
||||
`)
|
||||
return w.Write(_buffer.Bytes())
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ func main() {
|
||||
s.Publish("messages", &sse.Event{
|
||||
Data: []byte("third message"),
|
||||
})
|
||||
|
||||
}() // ...
|
||||
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
|
||||
Reference in New Issue
Block a user