files

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 2 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Overview

Package files contains small file-system helpers: extension parsing and existence checks that never panic on permission errors.

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