// ToFileName lowercases and underscores a go type name
767811
func ToFileName(name string) string {
	in := split(name)
	out := make([]string, 0, len(in))

	for _, w := range in {
		out = append(out, lower(w))
	}

	return strings.Join(out, "_")
}
1217269
func (l *LanguageOpts) MangleFileName(name string) string {
	if l.fileNameFunc != nil {
		return l.fileNameFunc(name)
	}
	return swag.ToFileName(name)
}
1289175
func (f *S3File) GetDataFilename() string {
	return fmt.Sprintf("s3://%s/%s/%s_%s_%s.%s", f.Bucket.Name, f.Subfolder, f.Schema, f.Table, f.DataDate.Format(time.RFC3339), f.Suffix)
}
1294782
func (c *SQLiteConn) GetFilename(schemaName string) string {
	if schemaName == "" {
		schemaName = "main"
	}
	return C.GoString(C.sqlite3_db_filename(c.db, C.CString(schemaName)))
}
923447
func (c *downloadCommand) ResolveFilename() string {
	filename := c.Filename
	if filename == "" {
		filename = backups.FilenamePrefix + c.ID + ".tar.gz"
	}
	return filename
}
897803
func (c *Command) MarkFlagFilename(name string, extensions ...string) error {
	return MarkFlagFilename(c.Flags(), name, extensions...)
}
1204013
func SetFilename(name string) (err error) {
	file, err := os.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
	if err != nil {
		return
	}
	SetOutput(file)
	return
}
1366054
func (c *ConfigFile) Filename() string {
	rw, err := NewConfigReadWriter(c.version)
	if err != nil {
		return ""
	}
	return rw.Filename(c)
}
1167698
func (i *Installation) GetSingleFileName() string {
	if i == nil || i.SingleFileName == nil {
		return ""
	}
	return *i.SingleFileName
}
1290166
func (fac FileAvailableCheck) Name() string {
	if fac.Label != "" {
		return fac.Label
	}
	return fmt.Sprintf("FileAvailable-%s", strings.Replace(fac.Path, "/", "-", -1))
}
588267
func NewFileName(X *xgbutil.XUtil, fileName string) (*Image, error) {
	srcReader, err := os.Open(fileName)
	if err != nil {
		return nil, err
	}
	defer srcReader.Close()

	img, _, err := image.Decode(srcReader)
	if err != nil {
		return nil, err
	}
	return NewConvert(X, img), nil
}
959673
func (t *File) Name() string {
	if t.fh == nil {
		return ""
	}
	return t.fh.Name()
}
142380
func ptsname(f *os.File) (string, error) {
	ptspath, err := C.ptsname(C.int(f.Fd()))
	if err != nil {
		return "", err
	}
	return C.GoString(ptspath), nil
}
271260
func keyFileName(keyAddr common.Address) string {
	ts := time.Now().UTC()
	return fmt.Sprintf("UTC--%s--%s", toISO8601(ts), hex.EncodeToString(keyAddr[:]))
}
1216586
func (t *transformer) transformGoFile(filename string) error {
	t.fset = token.NewFileSet()
	file, err := parser.ParseFile(t.fset, filename, nil, parser.ParseComments)
	if err != nil {
		return err
	}

	t.PackageName = file.Name.Name
	t.services, err = getServices(file)
	if err != nil {
		return err
	}
	if len(t.services) == 0 {
		return nil
	}

	t.inPRPCPackage, err = isInPackage(filename, prpcPackagePath)
	if err != nil {
		return err
	}

	if err := t.transformFile(file); err != nil {
		return err
	}

	var buf bytes.Buffer
	if err := printer.Fprint(&buf, t.fset, file); err != nil {
		return err
	}
	formatted, err := gofmt(buf.Bytes())
	if err != nil {
		return err
	}

	return ioutil.WriteFile(filename, formatted, 0666)
}
940207
func (c *fileCache) filename(key string) string {
	return path.Join(c.dirname, c.nameFn(key))
}
131259
func (h *AttachmentHeader) Filename() (string, error) {
	_, params, err := h.ContentDisposition()

	filename, ok := params["filename"]
	if !ok {
		// Using "name" in Content-Type is discouraged
		_, params, err = h.ContentType()
		filename = params["name"]
	}

	return filename, err
}