mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
fix line endings... | Prev Commit: 15feaf0237
[formerly dced7d472edabbab4f80c76051f13261928a8dea]?w=1
Former-commit-id: 286366ffb0958288821d0b34b6140e203400c682
This commit is contained in:
parent
15feaf0237
commit
42bc7dbad0
7
.gitattributes
vendored
7
.gitattributes
vendored
|
@ -2,3 +2,10 @@
|
||||||
vendor/* linguist-vendored
|
vendor/* linguist-vendored
|
||||||
_examples/* linguist-documentation
|
_examples/* linguist-documentation
|
||||||
_benchmarks/* linguist-documentation
|
_benchmarks/* linguist-documentation
|
||||||
|
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||||
|
# if from windows:
|
||||||
|
# git config --global core.autocrlf true
|
||||||
|
# if from unix:
|
||||||
|
# git config --global core.autocrlf input
|
||||||
|
# https://help.github.com/articles/dealing-with-line-endings/#per-repository-settings
|
||||||
|
* text=auto
|
81
FAQ.md
Normal file
81
FAQ.md
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
# FAQ
|
||||||
|
|
||||||
|
## How to upgrade
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go get -u github.com/kataras/iris
|
||||||
|
```
|
||||||
|
|
||||||
|
## Learning
|
||||||
|
|
||||||
|
More than 50 practical examples, tutorials and articles at:
|
||||||
|
|
||||||
|
- https://github.com/kataras/iris/tree/master/_examples
|
||||||
|
- https://github.com/iris-contrib/examples
|
||||||
|
- https://iris-go.com/v8/recipe
|
||||||
|
- https://docs.iris-go.com (in-progress)
|
||||||
|
- https://godoc.org/github.com/kataras/iris
|
||||||
|
|
||||||
|
> [Stay tuned](https://github.com/kataras/iris/stargazers), community prepares even more tutorials.
|
||||||
|
|
||||||
|
Want to help and join to the greatest community? Describe your skills and push your own sections at: https://github.com/kataras/build-a-better-web-together/issues/new
|
||||||
|
|
||||||
|
### common errors that new gophers may meet
|
||||||
|
|
||||||
|
#### type aliases
|
||||||
|
|
||||||
|
| build error | reason | solution |
|
||||||
|
| -----------|--------|--------|
|
||||||
|
| `undefined iris.Context` | caused of using the **optional type alias** `iris.Context` instead of the `context.Context` when building with Go 1.8 | import the original package `github.com/kataras/iris/context` and declare as `func(context.Context){})` **or** download and install the [latest go version](https://golang.org/dl) _recommended_ |
|
||||||
|
|
||||||
|
Type alias is a new feature, introduced at Go version 1.9, so if you want to use Iris' type aliases you have to build using the latest Go version. Nothing really changes for your application if you use type alias or not, Iris' type aliases helps you to omit import statements -- to reduce lines of code, nothing more.
|
||||||
|
|
||||||
|
**Details...**
|
||||||
|
|
||||||
|
Go version 1.9 introduced the [type alias](https://golang.org/doc/go1.9#language) feature.
|
||||||
|
|
||||||
|
Iris uses the `type alias` feature to help you writing less code by omitting some package imports. The examples and documentation are written using Go 1.9 as well.
|
||||||
|
|
||||||
|
If you build your Go app with Go 1.9 you can, optionally, use all Iris web framework's features by importing one single package, the `github.com/kataras/iris`.
|
||||||
|
|
||||||
|
Available type aliases;
|
||||||
|
|
||||||
|
| Go 1.8 | Go 1.8 usage | Go 1.9 usage (optionally) |
|
||||||
|
| -----------|--------|--------|
|
||||||
|
| `import "github.com/kataras/iris/context"` | `func(context.Context) {}`, `context.Handler`, `context.Map` | `func(iris.Context) {}`, `iris.Handler`, `iris.Map` |
|
||||||
|
| `import "github.com/kataras/iris/mvc"` | `type MyController struct { mvc.Controller }` , `mvc.SessionController` | `type MyController struct { iris.Controller }`, `iris.SessionController` |
|
||||||
|
| `import "github.com/kataras/iris/core/router"` | `app.PartyFunc("/users", func(p router.Party) {})` | `app.PartyFunc("/users", func(p iris.Party) {})` |
|
||||||
|
| `import "github.com/kataras/iris/core/host"` | `app.ConfigureHost(func(s *host.Supervisor) {})` | `app.ConfigureHost(func(s *iris.Supervisor) {})` |
|
||||||
|
|
||||||
|
You can find all type aliases and their original package import statements at the [./context.go file](context.go).
|
||||||
|
|
||||||
|
> Remember; this doesn't mean that you have to use those type aliases, you can still import the original packages as you did with Go version 1.8, it's up to you.
|
||||||
|
|
||||||
|
## Active development mode
|
||||||
|
|
||||||
|
Iris may have reached version 8, but we're not stopping there. We have many feature ideas on our board that we're anxious to add and other innovative web development solutions that we're planning to build into Iris.
|
||||||
|
|
||||||
|
## Can I find a job if I learn how to use Iris?
|
||||||
|
|
||||||
|
Yes, not only because you will learn Golang in the same time, but there are some positions
|
||||||
|
open for Iris-specific developers the time we speak.
|
||||||
|
|
||||||
|
- https://glints.id/opportunities/jobs/5553
|
||||||
|
|
||||||
|
## Can Iris be used in production after Dubai purchase?
|
||||||
|
|
||||||
|
Yes, now more than ever.
|
||||||
|
|
||||||
|
https://github.com/kataras/iris/issues/711
|
||||||
|
|
||||||
|
## Do we have a community Chat?
|
||||||
|
|
||||||
|
Yes, https://kataras.rocket.chat/channel/iris.
|
||||||
|
|
||||||
|
https://github.com/kataras/iris/issues/646
|
||||||
|
|
||||||
|
## How this open-source project still active and shine?
|
||||||
|
|
||||||
|
By normal people like you, who help us by donating small or larger amounts of money.
|
||||||
|
|
||||||
|
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras)!
|
|
@ -85,7 +85,7 @@ func assetsCssBootstrapMinCss() (*asset, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "assets/css/bootstrap.min.css", size: 141513, mode: os.FileMode(438), modTime: time.Unix(1499700236, 0)}
|
info := bindataFileInfo{name: "assets/css/bootstrap.min.css", size: 141513, mode: os.FileMode(511), modTime: time.Unix(1499700236, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ func assetsFaviconIco() (*asset, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "assets/favicon.ico", size: 15086, mode: os.FileMode(438), modTime: time.Unix(1496572980, 0)}
|
info := bindataFileInfo{name: "assets/favicon.ico", size: 15086, mode: os.FileMode(511), modTime: time.Unix(1496572980, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ func assetsJsJquery211Js() (*asset, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "assets/js/jquery-2.1.1.js", size: 256541, mode: os.FileMode(438), modTime: time.Unix(1499700236, 0)}
|
info := bindataFileInfo{name: "assets/js/jquery-2.1.1.js", size: 256541, mode: os.FileMode(511), modTime: time.Unix(1499700236, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ func (r resource) loadFromBase(dir string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
result := string(b)
|
result := string(b)
|
||||||
if runtime.GOOS != "windows" {
|
//if runtime.GOOS != "windows" {
|
||||||
result = strings.Replace(result, "\n", "\r\n", -1)
|
// result = strings.Replace(result, "\n", "\r\n", -1)
|
||||||
}
|
//}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -35,9 +34,9 @@ func (r resource) loadFromBase(dir string) string {
|
||||||
panic(fullpath + " failed with error: " + err.Error())
|
panic(fullpath + " failed with error: " + err.Error())
|
||||||
}
|
}
|
||||||
result := string(b)
|
result := string(b)
|
||||||
if runtime.GOOS != "windows" {
|
// if runtime.GOOS != "windows" {
|
||||||
result = strings.Replace(result, "\n", "\r\n", -1)
|
// result = strings.Replace(result, "\n", "\r\n", -1)
|
||||||
}
|
// }
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user