stringsx

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package stringsx provides string utility functions.

This package offers helpful string manipulation utilities that complement the standard library's strings package. Functions focus on common use cases like secret masking, safe string handling, and text processing.

Features:

  • MaskSecret: Secure display of sensitive data
  • (Additional utilities to be added)

Example usage:

import "github.com/spcent/plumego/internal/stringsx"

// Mask a secret for logging
apiKey := "myapikey_1234567890abcdefghijklmn"
masked := stringsx.MaskSecret(apiKey)  // "my**************************mn"

// Safe for empty strings
empty := stringsx.MaskSecret("")       // ""

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaskSecret

func MaskSecret(s string) string

MaskSecret masks a secret for display. Rules: - empty => "" - len<=4 => "****" (same length) - otherwise => keep first 2 and last 2, middle masked

Types

This section is empty.

Jump to

Keyboard shortcuts

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