Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
authorAleksandr Demakin <alexander.demakin@gmail.com>2021-01-22 22:05:08 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-01-23 02:39:14 +0300
commitee9c1367635eab446fcf9baa1ab8b4066882548e (patch)
tree4285ebe33734da51abc8f5e04ce0c324167c6b4d /tpl
parent32b86076ee1c0833b538b84e1cc9e6d79babecf2 (diff)
tpl/os: remove 1mb limit for readFile.
Diffstat (limited to 'tpl')
-rw-r--r--tpl/os/os.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/tpl/os/os.go b/tpl/os/os.go
index 214706593..e729b810b 100644
--- a/tpl/os/os.go
+++ b/tpl/os/os.go
@@ -18,7 +18,6 @@ package os
import (
"errors"
"fmt"
- "os"
_os "os"
"github.com/gohugoio/hugo/deps"
@@ -62,22 +61,11 @@ func (ns *Namespace) Getenv(key interface{}) (string, error) {
// readFile reads the file named by filename in the given filesystem
// and returns the contents as a string.
-// There is a upper size limit set at 1 megabytes.
func readFile(fs afero.Fs, filename string) (string, error) {
if filename == "" {
return "", errors.New("readFile needs a filename")
}
- if info, err := fs.Stat(filename); err == nil {
- if info.Size() > 1000000 {
- return "", fmt.Errorf("file %q is too big", filename)
- }
- } else {
- if os.IsNotExist(err) {
- return "", fmt.Errorf("file %q does not exist", filename)
- }
- return "", err
- }
b, err := afero.ReadFile(fs, filename)
if err != nil {
return "", err