// 检查密码(密码原文，数据库中保存的哈希过后的密码，数据库中保存的盐值)
493003
func CheckPassword(rawPassword string, hashedPassword string, salt string) bool {
	return MakePassword(rawPassword, salt) == hashedPassword
}
851571
func (env *Glisp) ParseFile(file string) ([]Sexp, error) {
	in, err := os.Open(file)
	if err != nil {
		return nil, err
	}

	var exp []Sexp

	exp, err = env.ParseStream(in)

	in.Close()

	return exp, err
}
725045
func (g *Group) File(path, file string) {
	g.server.File(g.prefix+path, file)
}
841912
func (l *Linter) Lint(filename string, src []byte) ([]Problem, error) {
	return l.LintFiles(map[string][]byte{filename: src})
}
120911
func PostFile(url, form_name, file_name, path string) (res *http.Response, err error) {
	buf := new(bytes.Buffer) // caveat IMO dont use this for large files, \
	// create a tmpfile and assemble your multipart from there (not tested)
	w := multipart.NewWriter(buf)

	fw, err := w.CreateFormFile(form_name, file_name) //这里的file必须和服务器端的FormFile一致
	if err != nil {
		return
	}
	fd, err := os.Open(path)
	if err != nil {
		return
	}
	defer fd.Close()
	// Write file field from file to upload
	_, err = io.Copy(fw, fd)
	if err != nil {
		return
	}
	// Important if you do not close the multipart writer you will not have a
	// terminating boundry
	w.Close()
	req, err := http.NewRequest("POST", url, buf)
	if err != nil {
		return
	}
	req.Header.Set("Content-Type", w.FormDataContentType())
	var client http.Client
	res, err = client.Do(req)
	return
}
502577
func File(
	path string,
	includePatterns []string,
	excludePatterns []string,
) (string, error) {
	if excluded, err := MatchAny(path, excludePatterns); err != nil {
		return "", err
	} else if excluded {
		return "", nil
	}
	if included, err := MatchAny(path, includePatterns); err != nil {
		return "", err
	} else if included {
		return path, nil
	}
	return "", nil
}
1169504
func Dump(file string, v interface{}) error {
	b, err := Marshal(v)
	if err != nil {
		return err
	}

	return ioutil.WriteFile(file, b, 0644)
}
619321
func (d *DotGit) Shallow() (billy.File, error) {
	f, err := d.fs.Open(shallowPath)
	if err != nil {
		if os.IsNotExist(err) {
			return nil, nil
		}

		return nil, err
	}

	return f, nil
}
61003
func preservedFile(err error, path string, out io.Writer) error {
	if len(path) > 0 {
		if _, err := os.Stat(path); !os.IsNotExist(err) {
			fmt.Fprintf(out, "A copy of your changes has been stored to %q\n", path)
		}
	}
	return err
}
574734
func (f File) String() string {
	var buf bytes.Buffer
	for _, l := range f.lines {
		buf.WriteString(l.String())
	}
	return buf.String()
}
185070
func (c *Context) File(filepath string) {
	http.ServeFile(c.Writer, c.Request, filepath)
}
1343263
func (file *File) Close() (err error) {
	defer func() {
		if err != nil {
			os.Remove(file.tmpfile.Name())
			file.aborted = true
		}
	}()

	if file.closed {
		err = errors.New("close on closed file")
		return
	}
	if file.aborted {
		err = errors.New("close on aborted file")
		return
	}

	if err = file.tmpfile.Close(); err != nil {
		return
	}

	err = os.Rename(file.tmpfile.Name(), file.name)

	file.closed = true
	return
}
1339884
func (e *Error) Error() string {
	filename := e.Pos.Filename
	if filename == "" {
		filename = "<source>"
	}
	return fmt.Sprintf("%s:%d:%d: %s", filename, e.Pos.Line, e.Pos.Column, e.Message)
}
1346396
func saveJson(obj interface{}, fname string) (err error) {
  var data []byte
  data, err = json.Marshal(&obj)
  if err == nil {
    var buff bytes.Buffer
    err = json.Indent(&buff, data, " ", "  ")
    if err == nil {
      err = ioutil.WriteFile(fname, buff.Bytes(), 0600)
    }
  }
  return
}
60762
func (w *File) Close() error {
	if w.tempFile != nil {
		if err := cleanupFile(w.tempFile); err != nil {
			return err
		}
		w.tempFile = nil
	}

	if w.file != nil {
		if err := cleanupFile(w.file); err != nil {
			return err
		}
		w.file = nil
	}

	return nil
}
504210
func (d *Context) CompileLstringFilename(flags uint, src string, lenght int) {
	__src__ := C.CString(src)
	C._duk_compile_lstring_filename(d.duk_context, C.duk_uint_t(flags), __src__, C.duk_size_t(lenght))
	C.free(unsafe.Pointer(__src__))
}
1153258
func File(configFile string, skipNonExistent bool) *configSource {
	var from string
	if configFile == STDINFileIdentifier {
		from = "Config from STDIN"
	} else {
		from = fmt.Sprintf("Config file at '%s'", configFile)
	}
	return &configSource{
		skip: ShouldSkipFile(configFile, skipNonExistent),
		from: from,
		apply: func(baseConfig interface{}) error {
			return FromFile(configFile, baseConfig)
		},
	}
}