Skip to content

Commit 9de6554

Browse files
committed
Add documentation
1 parent 3c69897 commit 9de6554

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# go-strftime
22

3+
[![GoDoc](https://godoc.org/github.com/imperfectgo/go-strftime?status.svg)](https://godoc.org/github.com/imperfectgo/go-strftime)
4+
[![Build Status](https://travis-ci.org/imperfectgo/go-strftime.svg?branch=master)](https://travis-ci.org/imperfectgo/go-strftime)
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/imperfectgo/go-strftime)](https://goreportcard.com/report/github.com/imperfectgo/go-strftime)
6+
[![Coverage](https://codecov.io/gh/imperfectgo/go-strftime/branch/master/graph/badge.svg)](https://codecov.io/gh/imperfectgo/go-strftime)
7+
38
High performance C99-compatible `strftime` formatter for Go.
49

510
**EXPERIMENTAL** Please DO NOT USE for now.

format.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ const (
4949
stdMask = 1<<stdArgShift - 1 // mask out argument
5050
)
5151

52+
// Format returns a textual representation of the time value formatted
53+
// according to C99-compatible strftime layout.
5254
func Format(t time.Time, layout string) string {
5355
const bufSize = 64
5456
var b [bufSize]byte
@@ -57,6 +59,8 @@ func Format(t time.Time, layout string) string {
5759
return string(buf)
5860
}
5961

62+
// AppendFormat is like Format but appends the textual
63+
// representation to b and returns the extended buffer.
6064
func AppendFormat(b []byte, t time.Time, layout string) []byte {
6165
var (
6266
name, offset, abs = locabs(&t)

0 commit comments

Comments
 (0)