Skip to content

xiaoyu830411/properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

properties

这是一个golang的lib,读取 properties 文件

#it is global elements
key = value
...

#it is section
[section]
key = value
...

#安装

go get -u github.com/xiaoyu830411/properties

#快速使用

package main

import (
	"github.com/xiaoyu830411/properties"
)

func main() {
  //get a value by key
  p, err := properties.Load("file path")
  if err != nil {
     ...
  }
  
  value, ok := p.Get("key")
  if ok {
    ...
  }
  
  //get section by section id
  section, ok := p.GetSection("section id")
  
  if ok {
    //get value by key from section
    value, ok := section.Get("key")
  }
}

About

Same as properties of java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages