From c25db39a9e6838cbdfc240de47230f3ebd16f2fa Mon Sep 17 00:00:00 2001 From: Sugat Bajracharya Date: Thu, 9 Feb 2023 10:53:05 +0545 Subject: [PATCH 1/2] Bug: Fix install issue --- dateConverter/converter_test.go | 4 ++-- go.mod | 2 +- nepalitime/nepalitime_test.go | 6 +++--- nepalitime/parser_test.go | 2 +- nepalitime/utils.go | 4 ++-- nepalitime/utils_test.go | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dateConverter/converter_test.go b/dateConverter/converter_test.go index f2f9d17..230edce 100644 --- a/dateConverter/converter_test.go +++ b/dateConverter/converter_test.go @@ -1,13 +1,13 @@ // Unit tests for date converter // // To run only this test -// go test -v github.com/opensource-nepal/nepali/dateConverter +// go test -v github.com/opensource-nepal/go-nepali/dateConverter package dateConverter_test import ( "testing" - "github.com/opensource-nepal/nepali/dateConverter" + "github.com/opensource-nepal/go-nepali/dateConverter" "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index b0e818d..a5605fd 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/opensource-nepal/nepali +module github.com/opensource-nepal/go-nepali go 1.19 diff --git a/nepalitime/nepalitime_test.go b/nepalitime/nepalitime_test.go index cb76cd4..b05d532 100644 --- a/nepalitime/nepalitime_test.go +++ b/nepalitime/nepalitime_test.go @@ -1,15 +1,15 @@ // Unit tests for NepaliTime object // // To run only this test -// go test -v github.com/opensource-nepal/nepali/nepalitime +// go test -v github.com/opensource-nepal/go-nepali/nepalitime package nepalitime_test import ( "testing" "time" - "github.com/opensource-nepal/nepali/constants" - "github.com/opensource-nepal/nepali/nepalitime" + "github.com/opensource-nepal/go-nepali/constants" + "github.com/opensource-nepal/go-nepali/nepalitime" "github.com/stretchr/testify/assert" ) diff --git a/nepalitime/parser_test.go b/nepalitime/parser_test.go index 68f1b0b..f3419df 100644 --- a/nepalitime/parser_test.go +++ b/nepalitime/parser_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/opensource-nepal/nepali/nepalitime" + "github.com/opensource-nepal/go-nepali/nepalitime" "github.com/stretchr/testify/assert" ) diff --git a/nepalitime/utils.go b/nepalitime/utils.go index 09ebac5..a58c5aa 100644 --- a/nepalitime/utils.go +++ b/nepalitime/utils.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/opensource-nepal/nepali/constants" - "github.com/opensource-nepal/nepali/dateConverter" + "github.com/opensource-nepal/go-nepali/constants" + "github.com/opensource-nepal/go-nepali/dateConverter" ) // Date returns the Time corresponding to diff --git a/nepalitime/utils_test.go b/nepalitime/utils_test.go index 20edff7..1412485 100644 --- a/nepalitime/utils_test.go +++ b/nepalitime/utils_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/opensource-nepal/nepali/constants" - "github.com/opensource-nepal/nepali/nepalitime" + "github.com/opensource-nepal/go-nepali/constants" + "github.com/opensource-nepal/go-nepali/nepalitime" "github.com/stretchr/testify/assert" ) From c00b888018172ade08b07aeb8c46638b83d27aed Mon Sep 17 00:00:00 2001 From: Sugat Bajracharya Date: Thu, 9 Feb 2023 10:59:38 +0545 Subject: [PATCH 2/2] Update README --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8ef0be0..d6c2383 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ We'll try to include all the features provided in the aforementioned package. We To install this package use `go get` ```shell -$ go get -u github.com/opensource-nepal/nepali +$ go get -u github.com/opensource-nepal/go-nepali ``` Or if there is some error then, use `go install` ```shell -$ go install github.com/opensource-nepal/nepali +$ go install github.com/opensource-nepal/go-nepali ``` #### Usage @@ -35,7 +35,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 1. To get a Nepali datetime object: ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" npTime, err := nepalitime.Date(2079, 10, 15, 14, 29, 6, 7) ``` @@ -50,7 +50,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 2. If you already have a `time.Time` object then, you can get the corresponding `NepaliTime` object using the function `FromEnglishTime`: ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" // just to ensure that the timezone is Asia/Kathmandu // else the time will be adjusted accordingly @@ -61,7 +61,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 3. To parse a datestring into a `NepaliTime` object the `Parse` function can be used. This is the Nepali equivalent of the `time.Parse` function of go but instead of using the time parsing format of `Mon Jan 2 15:04:05 -0700 MST 2006` we decided to go with the `%Y/%m/%d` style parsing. We intend on supporting the go style formatting in the upcoming releases. Please see [directives](#date-directives) section to know which directives we support. ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" datetimeStr := "2079/10/14" format := "%Y/%m/%d" @@ -72,7 +72,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 4. To get current Nepali time: ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" npTime := nepalitime.Now() ``` @@ -80,7 +80,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 5. To get the current English time in Nepal: ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" enTime := nepalitime.GetCurrentEnglishTime() ``` @@ -90,7 +90,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 1. This is one of the core functionalities in which an English date(not an object) is converted to Nepali date in parts i.e. year, month, day in an array: ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" // npDate is an array of 3 length which contains // year, month and day sequential form @@ -100,7 +100,7 @@ In this package, we provide 2 `go` packages, `nepalitime` and `dateConverter`. 2. To convert a Nepali date(not an object) to English date in parts i.e. year, month, day in an array: ```go - import "github.com/opensource-nepal/nepali/nepalitime" + import "github.com/opensource-nepal/go-nepali/nepalitime" // enDate is an array of 3 length which contains // year, month and day sequential form