organisationsnummer

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

organisationsnummer GitHub Workflow Status GoDoc Go Report Card

Validate Swedish organization numbers.

Installation

go get -u github.com/organisationsnummer/go

Example

package main

import (
	organisationsnummer "github.com/organisationsnummer/go"
)

func main() {
	organisationsnummer.Valid("202100-5489")
	//=> true
}

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOrganizationNumber = errors.New("Invalid Swedish organization number")
)

Functions

func Valid

func Valid(input string) bool

Valid will validate Swedish organization numbers

Types

type Organisationsnummer

type Organisationsnummer struct {
	// contains filtered or unexported fields
}

Organisationsnummer represents the organisationsnummer struct.

func New

func New(input string) (*Organisationsnummer, error)

New parse a Swedish organization numbers and returns a new struct or a error.

func Parse

func Parse(input string) (*Organisationsnummer, error)

Parse Swedish organization numbers and return a new struct.

func (*Organisationsnummer) Format

func (o *Organisationsnummer) Format(separator ...bool) string

Format a Swedish organization number as one of the official formats, a long format or a short format.

func (*Organisationsnummer) GetType

func (o *Organisationsnummer) GetType() string

Get the organization type.

func (*Organisationsnummer) IsPersonnummer

func (o *Organisationsnummer) IsPersonnummer() bool

Determine if personnummer or not.

func (*Organisationsnummer) Personnummer

func (o *Organisationsnummer) Personnummer() personnummer.Personnummer

Get Personnummer instance

func (*Organisationsnummer) String

func (o *Organisationsnummer) String() string

Get the organization type.

func (*Organisationsnummer) VatNumber added in v1.0.2

func (o *Organisationsnummer) VatNumber() string

Get vat number for a organization number.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL