tagparser – github.com/vmihailenco/tagparser Index | Examples | Files | Directories

package tagparser

import "github.com/vmihailenco/tagparser"

Index

Examples

Functions

func Unquote

func Unquote(s string) (string, bool)

Types

type Tag

type Tag struct {
	Name    string
	Options map[string]string
}

func Parse

func Parse(s string) *Tag
Example

Code:play 

package main

import (
	"fmt"

	"github.com/vmihailenco/tagparser"
)

func main() {
	tag := tagparser.Parse("some_name,key:value,key2:'complex value'")
	fmt.Println(tag.Name)
	fmt.Println(tag.Options)
}

Output:

some_name
map[key:value key2:'complex value']

func (*Tag) HasOption

func (t *Tag) HasOption(name string) bool

Source Files

tagparser.go

Directories

PathSynopsis
internal
Version
v0.1.2 (latest)
Published
Oct 1, 2020
Platform
windows/amd64
Imports
2 packages
Last checked
now

Tools for package owners.