Giter Site home page Giter Site logo

aohorodnyk / gotimeparser Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 23 KB

Golang time parser. This library provides an ability to parse time from many different formats at the same time.

Home Page: https://aohorodnyk.com/post/2023-03-06-gotimeparser-first-release/

License: BSD 3-Clause "New" or "Revised" License

Go 96.13% Shell 3.87%
go go-library go-mod go-module go-package golang golang-library parser time time-parsing

gotimeparser's Introduction

Go universal time format parser

GitHub Workflow Status License GitHub issues GitHub issues The latest release version GoDoc

Background

Many companies use service to service integration through different API porotocols. I had the same situation in my production environment. At some point, clients of my service started to send me dates in different formats.

Some of them sent timestamps in int, some of them used ISO 8601, etc. But what was clear, these dates were valid and we could not request to change it in one day.

As a result of this issue, I implemented some solution that solved the issue and wrote a couple of articles that shared the issue and the approach:

  1. Parse timestamp formats
  2. Parse time from different non timestamp formats
  3. Universal time UnmarshalJSON implementation

But I did not want to create an Open Source package, because of I believe that Open Source cannot be just few lines of code. It's a right formatting of the code, some code coverage by tests, examples and the most important - is commitment to support it.

Documentation

To make documentation more standartized and always up-to-date, we use GoDoc (pkg.go.dev/github.com/aohorodnyk/gotimeparser). It is the best documentation tool for Go.

Every feature or feature change should introduce some changes in comments, doc.go, README.md and tests include examples.

Contributing

The library is open source and you can contribute to it.

Before contrbution, make sure that githook is configured for you and all your commits contain the correct issue tag.

Branch Name

Before you start the contribution, make sure that you are on the correct branch. Branch name should start from the issue number dash and short explanation with spaces replaced by underscores. Example:

  • 1-my_feature
  • 2-fix_bug
  • 234-my_important_pr

Git Hook

To configure the git hook, you need to simply run the command: git config core.hooksPath .githooks

It will configure the git hook to run the pre-commit script. Source code of the hook is in .githooks/prepare-commit-msg.

This git-hook will parse branch name and add the issue tag to the commit message.

gotimeparser's People

Contributors

aohorodnyk avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.