Categorygithub.com/krnkl/go-week
modulepackage
0.0.2
Repository: https://github.com/krnkl/go-week.git
Documentation: pkg.go.dev

# README

Build Status Coverage Status GoDoc

go-week

The package go-week provides a simple data type representing a week date as defined by ISO 8601.

Versions and stability

This package can be considered mostly stable but not yet ready to use. All releases follow the rules of semantic versioning.

Although the master branch is supposed to remain stable, there is not guarantee that braking changes will not be merged into master when major versions are released. Therefore the repository contains version tags in order to support vendoring tools such as glide. The tag names follow common conventions and have the following format v1.0.0.

Dependencies

Build dependencies

  • github.com/pkg/errors

Test dependencies

  • github.com/DATA-DOG/go-sqlmock
  • github.com/lib/pq (integration tests only)
  • github.com/stretchr/testify/...

Run unit and integration tests

Commands used for linting and testing:

gometalinter --config=.gometalinter.json .
go test .

# with integration tests (requires test db)
go test -tags=integration .

License

This project is open source an published under the MIT license.

# Functions

FromTime converts time.Time into a Week.
New creates a new Week object from the specified year and week.
NewNullWeek creates a new NullWeek.
NullWeekFrom creates a new NullWeek that will always be valid.
NullWeekFromPtr creates a new NullWeek that may be null if week is nil.

# Structs

NullWeek is a nullable Week representation.
Week represents a week date as defined by ISO 8601.