comment update for package garray

This commit is contained in:
john
2020-05-22 12:04:58 +08:00
parent f05f855c07
commit a5a267567c
10 changed files with 35 additions and 14 deletions

View File

@ -4,5 +4,5 @@
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
// Package garray provides concurrent-safe/unsafe arrays.
// Package garray provides most commonly used array containers which also support concurrent-safe/unsafe switch feature.
package garray

View File

@ -22,6 +22,8 @@ import (
)
// Array is a golang array with rich features.
// It contains a concurrent-safe/unsafe switch, which should be set
// when its initialization and cannot be changed then.
type Array struct {
mu rwmutex.RWMutex
array []interface{}

View File

@ -20,6 +20,8 @@ import (
)
// IntArray is a golang int array with rich features.
// It contains a concurrent-safe/unsafe switch, which should be set
// when its initialization and cannot be changed then.
type IntArray struct {
mu rwmutex.RWMutex
array []int

View File

@ -22,6 +22,8 @@ import (
)
// StrArray is a golang string array with rich features.
// It contains a concurrent-safe/unsafe switch, which should be set
// when its initialization and cannot be changed then.
type StrArray struct {
mu rwmutex.RWMutex
array []string

View File

@ -22,7 +22,10 @@ import (
)
// SortedArray is a golang sorted array with rich features.
// It's using increasing order in default.
// It is using increasing order in default, which can be changed by
// setting it a custom comparator.
// It contains a concurrent-safe/unsafe switch, which should be set
// when its initialization and cannot be changed then.
type SortedArray struct {
mu rwmutex.RWMutex
array []interface{}

View File

@ -19,7 +19,10 @@ import (
)
// SortedIntArray is a golang sorted int array with rich features.
// It's using increasing order in default.
// It is using increasing order in default, which can be changed by
// setting it a custom comparator.
// It contains a concurrent-safe/unsafe switch, which should be set
// when its initialization and cannot be changed then.
type SortedIntArray struct {
mu rwmutex.RWMutex
array []int

View File

@ -20,7 +20,10 @@ import (
)
// SortedStrArray is a golang sorted string array with rich features.
// It's using increasing order in default.
// It is using increasing order in default, which can be changed by
// setting it a custom comparator.
// It contains a concurrent-safe/unsafe switch, which should be set
// when its initialization and cannot be changed then.
type SortedStrArray struct {
mu rwmutex.RWMutex
array []string

View File

@ -5,7 +5,7 @@
// You can obtain one at https://github.com/gogf/gf.
//
// Package glist provides a concurrent-safe/unsafe doubly linked list.
// Package glist provides most commonly used doubly linked list container which also supports concurrent-safe/unsafe switch feature.
package glist
import (
@ -19,11 +19,13 @@ import (
)
type (
// List is a doubly linked list containing a concurrent-safe/unsafe switch.
// The switch should be set when its initialization and cannot be changed then.
List struct {
mu rwmutex.RWMutex
list list.List
}
// Element the item type of the list.
Element = list.Element
)

View File

@ -4,7 +4,7 @@
// If a copy of the MIT was not distributed with gm file,
// You can obtain one at https://github.com/gogf/gf.
// Package gmap provides concurrent-safe/unsafe map containers.
// Package gmap provides most commonly used map container which also support concurrent-safe/unsafe switch feature.
package gmap
type (

View File

@ -173,12 +173,12 @@ func (c *Config) SetPath(path string) error {
return nil
}
// SetViolenceCheck sets whether to perform hierarchical conflict check.
// SetViolenceCheck sets whether to perform hierarchical conflict checking.
// This feature needs to be enabled when there is a level symbol in the key name.
// The default is off.
// Turning on this feature is quite expensive,
// and it is not recommended to allow separators in the key names.
// It is best to avoid this on the application side.
// It is off in default.
//
// Note that, turning on this feature is quite expensive, and it is not recommended
// to allow separators in the key names. It is best to avoid this on the application side.
func (c *Config) SetViolenceCheck(check bool) {
c.vc = check
c.Clear()
@ -186,8 +186,12 @@ func (c *Config) SetViolenceCheck(check bool) {
// AddPath adds a absolute or relative path to the search paths.
func (c *Config) AddPath(path string) error {
isDir := false
realPath := ""
var (
isDir = false
realPath = ""
)
// It firstly checks the resource manager,
// and then checks the filesystem for the path.
if file := gres.Get(path); file != nil {
realPath = path
isDir = file.FileInfo().IsDir()