...
Tawesoft Logo

Source file src/tawesoft.co.uk/go/humanizex/doc.go

Documentation: src/tawesoft.co.uk/go/humanizex/doc.go

     1  // tawesoft.co.uk/go/humanizex
     2  // 
     3  // Copyright © 2021 Tawesoft Ltd <open-source@tawesoft.co.uk>
     4  // Copyright © 2021 Ben Golightly <ben@tawesoft.co.uk>
     5  // 
     6  // Permission is hereby granted, free of charge, to any person obtaining a copy
     7  // of this software and associated documentation files (the "Software"), to deal
     8  // in the Software without restriction,  including without limitation the rights
     9  // to use,  copy, modify,  merge,  publish, distribute, sublicense,  and/or sell
    10  // copies  of  the  Software,  and  to  permit persons  to whom  the Software is
    11  // furnished to do so, subject to the following conditions:
    12  // 
    13  // The above copyright notice and this permission notice shall be included in all
    14  // copies or substantial portions of the Software.
    15  // 
    16  // THE SOFTWARE IS PROVIDED  "AS IS",  WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR
    17  // IMPLIED,  INCLUDING  BUT  NOT LIMITED TO THE WARRANTIES  OF  MERCHANTABILITY,
    18  // FITNESS FOR A PARTICULAR PURPOSE  AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    19  // AUTHORS  OR COPYRIGHT HOLDERS  BE LIABLE  FOR ANY  CLAIM,  DAMAGES  OR  OTHER
    20  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    21  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    22  // SOFTWARE.
    23  
    24  // Package humanizex is an elegant, general-purpose, extensible, modular,
    25  // locale-aware way to format and parse numbers and quantities - like distances,
    26  // bytes, and time - in a human-readable way ideal for config files and as a
    27  // building-block for fully translated ergonomic user interfaces.
    28  // 
    29  // If golang.org/x/text is ever promoted to core then there will be a new version
    30  // of this package named `humanize` (dropping the 'x').
    31  // 
    32  // What about dustin's go-humanize?
    33  // 
    34  // dustin's go-humanize (https://github.com/dustin/go-humanize) is 3.9 to 4.5
    35  // times faster formatting and 2 times faster parsing, if this is a bottleneck for
    36  // you. It's also quite mature, so is probably very well tested by now. If you're
    37  // only targeting the English language it also has more handy "out of the box"
    38  // features.
    39  // 
    40  // On the other hand, tawesoft's humanizex is more general purpose and has better
    41  // localisation support. Even with those extra features, tawesoft's humanizex
    42  // codebase is also smaller and simpler.
    43  // 
    44  // Examples
    45  // 
    46  // Example formatting and parsing Byte quantities in various locales
    47  //
    48  // https://www.tawesoft.co.uk/go/doc/humanizex/examples/simple/
    49  //
    50  // Example leveraging the raw parts of FormatParts to handle durations in a
    51  // custom even nicer way for the english language.
    52  //
    53  // https://www.tawesoft.co.uk/go/doc/humanizex/examples/custom-durations/
    54  //
    55  // Example using custom time factors from the Battlestar Galactica 1978 TV
    56  // series.
    57  //
    58  // https://www.tawesoft.co.uk/go/doc/humanizex/examples/custom-factors/
    59  //
    60  //
    61  // Package Information
    62  //
    63  // License: MIT (see LICENSE.txt)
    64  //
    65  // Stable: no
    66  //
    67  // For more information, documentation, source code, examples, support, links,
    68  // etc. please see https://www.tawesoft.co.uk/go and 
    69  // https://www.tawesoft.co.uk/go/humanizex
    70  package humanizex // import "tawesoft.co.uk/go/humanizex"
    71  
    72  // Code generated by internal. DO NOT EDIT.
    73  // Instead, edit DESC.txt and run mkdocs.sh.

View as plain text