laws

package module
v0.0.0-...-bb89e82 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

Laws

This package provides functionality to retrieve legal typification's related to a given subject. The package includes functions to read and parse a CSV file containing legal information and then store it in memory to provide quick access.

Install

To install this package, use go get:

go get github.com/DanielFillol/laws

Usage

Import the laws package and call the GetLawsBySubject function to retrieve legal typifications for a given subject.

package main

import (
	"fmt"
	"github.com/DanielFillol/laws"
)

func main() {
	typifications := laws.GetLawsBySubject("Crimes contra a vida / Homicídio Simples")
	fmt.Println(typifications)
}

This will be the output:

[{[{Artigo 121 do Decreto Lei nº 2.848 de 07 de Dezembro de 1940}] Homicídio} {[{Parágrafo 1 Artigo 205 do Decreto Lei nº 1.001 de 21 de Outubro de 1969}] Homicídio simples}]

Testing

This package includes a test file getLawsBySubject_test.go that tests the GetLawsBySubject function with various inputs. To run the tests, use go test:

go test

Contributing

Contributions are welcome! If you find a bug or would like to add a feature, please open an issue or pull request.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SubjectData []models.LawBySubject

Functions

func GetLawsBySubject

func GetLawsBySubject(subject string) []models.Typification

GetLawsBySubject returns legal typification's related to a given subject.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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