mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 12:31:58 +00:00
:)
This commit is contained in:
@@ -231,7 +231,7 @@ func jsJquery211Js() (*asset, error) {
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
cannonicalName := strings.ReplaceAll(name, "\\", "/")
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
|
||||
@@ -54,8 +54,8 @@ func (r resource) loadFromBase(dir string) string {
|
||||
result := string(b)
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
result = strings.Replace(result, "\n", "\r\n", -1)
|
||||
result = strings.Replace(result, "\r\r", "", -1)
|
||||
result = strings.ReplaceAll(result, "\n", "\r\n")
|
||||
result = strings.ReplaceAll(result, "\r\r", "")
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func (r resource) loadFromBase(dir string) string {
|
||||
result := string(b)
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
result = strings.Replace(result, "\n", "\r\n", -1)
|
||||
result = strings.ReplaceAll(result, "\n", "\r\n")
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ func (r resource) loadFromBase(dir string) string {
|
||||
}
|
||||
result := string(b)
|
||||
if runtime.GOOS != "windows" {
|
||||
result = strings.Replace(result, "\n", "\r\n", -1)
|
||||
result = strings.Replace(result, "\r\r", "", -1)
|
||||
result = strings.ReplaceAll(result, "\n", "\r\n")
|
||||
result = strings.ReplaceAll(result, "\r\r", "")
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ func beforeSave(ctx iris.Context, file *multipart.FileHeader) bool {
|
||||
ip := ctx.RemoteAddr()
|
||||
// make sure you format the ip in a way
|
||||
// that can be used for a file name (simple case):
|
||||
ip = strings.Replace(ip, ".", "_", -1)
|
||||
ip = strings.Replace(ip, ":", "_", -1)
|
||||
ip = strings.ReplaceAll(ip, ".", "_")
|
||||
ip = strings.ReplaceAll(ip, ":", "_")
|
||||
|
||||
// you can use the time.Now, to prefix or suffix the files
|
||||
// based on the current time as well, as an exercise.
|
||||
|
||||
Reference in New Issue
Block a user