files

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT Imports: 2 Imported by: 1

README

files — filesystem helpers

import "github.com/downsized-devs/sdk-go/files"

Stability: Stable — see STABILITY.md

Features

  • GetExtension(filename string) string — extension after the last dot, lowercased.
  • IsExist(filename string) bool — file existence check.

Installation

go get github.com/downsized-devs/sdk-go/files

Quick Start

import "github.com/downsized-devs/sdk-go/files"

_ = files.GetExtension("/tmp/report.PDF") // "pdf"
_ = files.IsExist("/tmp/report.pdf")       // true/false

API Reference

Symbol Signature
GetExtension (filename string) string
IsExist (filename string) bool

Dependencies

stdlib only.

Testing

go test ./files/...

Contributing

See CONTRIBUTING.md.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExtension

func GetExtension(filename string) string

Extract file extension e.g. "txt, csv, docx" from full filename. If file has no extension then return empty string

func IsExist

func IsExist(filename string) bool

Checks if a file exists and is not a directory

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL