Skip to content

Commit

Permalink
Merge pull request #5 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.2.2
  • Loading branch information
andyone committed Dec 23, 2015
2 parents abb889f + 1ab809a commit 44ed708
Show file tree
Hide file tree
Showing 44 changed files with 461 additions and 594 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go
go:
- 1.4.2
- 1.5.1
- 1.5.2
- release
- tip

Expand Down
23 changes: 12 additions & 11 deletions arg/arg.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for working with command-line arguments
// Package arg provides methods for working with command-line arguments
package arg

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -32,6 +32,7 @@ const (
FLOAT = 3
)

// Error codes
const (
ERROR_UNSUPPORTED = 0
ERROR_NO_NAME = 1
Expand All @@ -47,16 +48,16 @@ const (

// V basic argument struct
type V struct {
Mergeble bool // argument supports arguments value merging
Type int // argument type
Value interface{} // default value
Required bool // argument is required
Max float64 // maximum integer argument value
Min float64 // minimum integer argument value
Alias string // list of aliases

// Non exported field
set bool
Type int // argument type
Max float64 // maximum integer argument value
Min float64 // minimum integer argument value
Alias string // list of aliases
Mergeble bool // argument supports arguments value merging
Required bool // argument is required

set bool // Non exported field

Value interface{} // default value
}

// Map is map with list of argumens
Expand Down
110 changes: 57 additions & 53 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,70 @@
### Changelog
## Changelog

#### r6
#### v1.2.2

* [crypto] Small improvements in hash generation
* [csv] Increased code coverage
* [easing] Increased code coverage
* [fmtc] Increased code coverage
* [httputil] Increased code coverage
* [jsonutil] Increased code coverage
* [pid] Increased code coverage
* [req] Increased code coverage
* [req] Increased default timeout to 10 seconds
* [strutil] Increased code coverage
* [timeutil] Increased code coverage
* `[req]` Added flag for marking connection to close

#### r5
#### v1.2.1

* [log] Now buffered I/O must be enabled manually
* [log] Auto flushing for bufio
* `[crypto]` Small improvements in hash generation
* `[csv]` Increased code coverage
* `[easing]` Increased code coverage
* `[fmtc]` Increased code coverage
* `[httputil]` Increased code coverage
* `[jsonutil]` Increased code coverage
* `[pid]` Increased code coverage
* `[req]` Increased code coverage
* `[req]` Increased default timeout to 10 seconds
* `[strutil]` Increased code coverage
* `[timeutil]` Increased code coverage

#### r4
#### v1.2

* [system] Added json tags for User, Group and SessionInfo structs
* [usage] Info now can use os.Args[0] for info rendering
* [version] Added package for working with version in simver notation
* `[log]` Now buffered I/O must be enabled manually
* `[log]` Auto flushing for bufio

#### r3
#### v1.1.1

* [arg] Changed default fail values (int -1 → 0, float -1.0 → 0.0)
* [arg] Increased code coverage
* [arg] Many minor fixes
* [cron] Fixed rare bug
* [cron] Increased code coverage
* [crypto] Increased code coverage
* [easing] Increased code coverage
* [errutil] Increased code coverage
* [fmtc] Increased code coverage
* [fmtutil] Increased code coverage
* [jsonutil] Increased code coverage
* [knf] Fixed bug in Reload method for global config
* [knf] Improved Reload method
* [knf] Increased code coverage
* [log] Increased code coverage
* [mathutil] Increased code coverage
* [pid] Increased code coverage
* [rand] Increased code coverage
* [req] Fixed bug with Accept header
* [req] Increased code coverage
* [sliceutil] Increased code coverage
* [sortutil] Increased code coverage
* [spellcheck] Increased code coverage
* [strutil] Increased code coverage
* [system] Added method system.SetProcName for changing process name
* [timeutil] Fixed bug in PrettyDuration method
* [timeutil] Increased code coverage
* [tmp] Increased code coverage
* `[system]` Added json tags for User, Group and SessionInfo structs
* `[usage]` Info now can use os.Args`[0]` for info rendering
* `[version]` Added package for working with version in simver notation

#### r2
#### v1.1

* [system] Fixed bug in fs usage calculation
* [usage] Improved new Info struct creation
* `[arg]` Changed default fail values (int -1 → 0, float -1.0 → 0.0)
* `[arg]` Increased code coverage
* `[arg]` Many minor fixes
* `[cron]` Fixed rare bug
* `[cron]` Increased code coverage
* `[crypto]` Increased code coverage
* `[easing]` Increased code coverage
* `[errutil]` Increased code coverage
* `[fmtc]` Increased code coverage
* `[fmtutil]` Increased code coverage
* `[jsonutil]` Increased code coverage
* `[knf]` Fixed bug in Reload method for global config
* `[knf]` Improved Reload method
* `[knf]` Increased code coverage
* `[log]` Increased code coverage
* `[mathutil]` Increased code coverage
* `[pid]` Increased code coverage
* `[rand]` Increased code coverage
* `[req]` Fixed bug with Accept header
* `[req]` Increased code coverage
* `[sliceutil]` Increased code coverage
* `[sortutil]` Increased code coverage
* `[spellcheck]` Increased code coverage
* `[strutil]` Increased code coverage
* `[system]` Added method system.SetProcName for changing process name
* `[timeutil]` Fixed bug in PrettyDuration method
* `[timeutil]` Increased code coverage
* `[tmp]` Increased code coverage

#### r1
#### v1.0.1

* `[system]` Fixed bug in fs usage calculation
* `[usage]` Improved new Info struct creation

#### v1

Initial public release
3 changes: 2 additions & 1 deletion cron/cron.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for working with cron expressions
// Package cron provides methods for working with cron expressions
package cron

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -17,6 +17,7 @@ import (

// ////////////////////////////////////////////////////////////////////////////////// //

// Aliases
const (
YEARLY = "0 0 1 1 *"
ANNUALLY = "0 0 1 1 *"
Expand Down
3 changes: 3 additions & 0 deletions cron/cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ func (s *CronSuite) TestParsing(c *C) {

e10, err := Parse("0 12 1 1 Wed")

c.Assert(err, IsNil)
c.Assert(e10, NotNil)

c.Assert(
e10.Next(time.Date(2015, 6, 1, 0, 0, 0, 0, time.Local)),
Equals,
Expand Down
2 changes: 1 addition & 1 deletion crypto/filehash.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func FileHash(file string) string {

hasher := sha256.New()

_, err = io.Copy(hasher, fd)
io.Copy(hasher, fd)

return fmt.Sprintf("%064x", hasher.Sum(nil))
}
2 changes: 1 addition & 1 deletion crypto/passwd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package with utils for working with crypto data (passwords, uuids, file hashes)
// Package crypto contains utils for working with crypto data (passwords, uuids, file hashes)
package crypto

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion csv/csv.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package with simple csv parser
// Package csv contains simple csv parser
package csv

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
4 changes: 2 additions & 2 deletions easing/ease.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package with easing functions
// Package easing contains easing functions
package easing

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -14,7 +14,7 @@ import (

// ////////////////////////////////////////////////////////////////////////////////// //

// 2 * Pi
// DoublePi is 2 * Pi
const DoublePi = math.Pi * 2

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion env/env.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build !windows

// Package provides methods for working with environment variables
// Package env provides methods for working with environment variables
package env

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion errutil/errutil.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for working with errors
// Package errutil provides methods for working with errors
package errutil

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
19 changes: 8 additions & 11 deletions fmtc/fmtc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods similar to fmt for colored output
// Package fmtc provides methods similar to fmt for colored output
package fmtc

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -18,10 +18,9 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

const (
_CODE_RESET = "\033[0m"
_CODE_CLEAN_LINE = "\033[0K"
_CODE_BACKSPACE = "\b"
_CODE_BELL = "\a"
_CODE_RESET = "\033[0m"
_CODE_BACKSPACE = "\b"
_CODE_BELL = "\a"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -67,12 +66,9 @@ var codes = map[int]int{

// ////////////////////////////////////////////////////////////////////////////////// //

// Disable colors in output
// DisableColors disable colors in output
var DisableColors = false

// Used for TPrintf
var lastTPrintSize int

// ////////////////////////////////////////////////////////////////////////////////// //

// Println formats using the default formats for its operands and writes to standard
Expand Down Expand Up @@ -241,11 +237,12 @@ LOOP:
output.WriteString("{")
output.WriteString(colorCode)
output.WriteString("}")

return true
} else {
output.WriteString(colorCode)
}

output.WriteString(colorCode)

return false
}

Expand Down
7 changes: 3 additions & 4 deletions fmtutil/fmtutil.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for output formating
// Package fmtutil provides methods for output formating
package fmtutil

// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -25,10 +25,10 @@ const (
_TERA = 1099511627776
)

// Order separator
// OrderSeparator default order separator
var OrderSeparator = ","

// Size separator
// SizeSeparator default size separator
var SizeSeparator = ""

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -80,7 +80,6 @@ func ParseSize(size string) uint64 {
var (
mlt uint64
pfx string
err error
)

ns := strings.ToLower(strings.Replace(size, " ", "", -1))
Expand Down
2 changes: 1 addition & 1 deletion fsutil/fs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// +build !windows

// Package provides methods for working with files in posix compatible systems
// Package fsutil provides methods for working with files in posix compatible systems
package fsutil

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion httputil/httputil.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for working with http request/responses
// Package httputil provides methods for working with http request/responses
package httputil

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion jsonutil/jsonutil.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for working with json data
// Package jsonutil provides methods for working with json data
package jsonutil

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion knf/knf.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package provides methods for working with configs in KNF format
// Package knf provides methods for working with configs in KNF format
package knf

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
8 changes: 4 additions & 4 deletions knf/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type PropertyValidator func(config *Config, prop string, value interface{}) erro

// ////////////////////////////////////////////////////////////////////////////////// //

// Check if given config property is empty or not
// Empty check if given config property is empty or not
var Empty = func(config *Config, prop string, value interface{}) error {
if config.GetS(prop) == "" {
return fmt.Errorf("Property %s can't be empty", prop)
Expand All @@ -27,7 +27,7 @@ var Empty = func(config *Config, prop string, value interface{}) error {
return nil
}

// Check if given config property is less then defined value or not
// Less check if given config property is less then defined value or not
var Less = func(config *Config, prop string, value interface{}) error {
switch value.(type) {
case int, int32, int64, uint, uint32, uint64:
Expand All @@ -45,7 +45,7 @@ var Less = func(config *Config, prop string, value interface{}) error {
return nil
}

// Check if given config property is greater then defined value or not
// Greater check if given config property is greater then defined value or not
var Greater = func(config *Config, prop string, value interface{}) error {
switch value.(type) {
case int, int32, int64, uint, uint32, uint64:
Expand All @@ -65,7 +65,7 @@ var Greater = func(config *Config, prop string, value interface{}) error {
return nil
}

// Check if given config property is equals then defined value or not
// Equals check if given config property is equals then defined value or not
var Equals = func(config *Config, prop string, value interface{}) error {
switch value.(type) {
case int, int32, int64, uint, uint32, uint64:
Expand Down
Loading

0 comments on commit 44ed708

Please sign in to comment.