diff --git a/README.md b/README.md index 9a4003a..3a6c20a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Build Status](https://travis-ci.com/kernle32dll/nullable.svg?branch=master)](https://travis-ci.com/kernle32dll/nullable) -[![GoDoc](https://godoc.org/github.com/mwieser/nullable?status.svg)](http://godoc.org/github.com/mwieser/nullable) -[![Go Report Card](https://goreportcard.com/badge/github.com/mwieser/nullable)](https://goreportcard.com/report/github.com/mwieser/nullable) +[![GoDoc](https://godoc.org/github.com/allaboutapps/nullable?status.svg)](http://godoc.org/github.com/allaboutapps/nullable) +[![Go Report Card](https://goreportcard.com/badge/github.com/allaboutapps/nullable)](https://goreportcard.com/report/github.com/allaboutapps/nullable) [![codecov](https://codecov.io/gh/kernle32dll/nullable/branch/master/graph/badge.svg)](https://codecov.io/gh/kernle32dll/nullable) # nullable @@ -13,13 +13,13 @@ Inspired by [How to determine if a JSON key has been set to null or not provided To get the package, execute: ```bash -go get github.com/mwieser/nullable +go get github.com/allaboutapps/nullable ``` To import this package, add the following line to your code: ```bash -import "github.com/mwieser/nullable" +import "github.com/allaboutapps/nullable" ``` Refer to it as `nullable`. @@ -28,8 +28,8 @@ For more details, see the API documentation. # Example -``` go -import "github.com/mwieser/nullable" +```go +import "github.com/allaboutapps/nullable" func main() { usr := struct { @@ -65,6 +65,49 @@ func main() { } ``` +# go-swagger usage example + +```yaml +definitions: + NullableInt: + type: integer + example: 1234 + x-go-type: + import: + package: github.com/allaboutapps/nullable + type: Int + NullableInt16: + type: integer + example: 1234 + x-go-type: + import: + package: github.com/allaboutapps/nullable + type: Int16 + NullableFloat: + type: number + format: float + example: 1.5 + x-go-type: + import: + package: github.com/allaboutapps/nullable + type: Float32 + NullableFloat64: + type: number + format: float + example: 1.5 + x-go-type: + import: + package: github.com/allaboutapps/nullable + type: Float64 + NullableString: + type: string + example: example + x-go-type: + import: + package: github.com/allaboutapps/nullable + type: String +``` + # Contributing Please feel free to submit issues, fork the repository and send pull requests! diff --git a/examples/main.go b/examples/main.go index 666f116..d8ef333 100644 --- a/examples/main.go +++ b/examples/main.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/mwieser/nullable" + "github.com/allaboutapps/nullable" ) const ( diff --git a/go.mod b/go.mod index 66bd691..327c446 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mwieser/nullable +module github.com/allaboutapps/nullable go 1.14 diff --git a/go.sum b/go.sum index a180210..ac7e43d 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,6 @@ github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kN github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/mwieser/nullable v1.1.0 h1:Igyitt2fNe1TV0jC0KTD95hHZRslaF6mF4Sv5k4CuQk= -github.com/mwieser/nullable v1.1.0/go.mod h1:S73au+dSsJcj6dX7I16qhSwfFYB1d7SudK3Ci6O+Xb4= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=