Skip to content
Snippets Groups Projects
Verified Commit 75934eb0 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: vendoring #71

parent 61a1232e
No related branches found
No related tags found
No related merge requests found
Showing
with 135 additions and 144 deletions
//go:build !windows
// +build !windows
package ole
......
......@@ -29,7 +29,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//go:build purego || appengine || js
// +build purego appengine js
// This file contains an implementation of proto field accesses using package reflect.
......
......@@ -26,7 +26,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//go:build purego || appengine || js
// +build purego appengine js
// This file contains an implementation of proto field accesses using package reflect.
......
......@@ -29,7 +29,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//go:build !purego && !appengine && !js
// +build !purego,!appengine,!js
// This file contains the implementation of the proto field accesses using package unsafe.
......
......@@ -26,7 +26,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//go:build !purego && !appengine && !js
// +build !purego,!appengine,!js
// This file contains the implementation of the proto field accesses using package unsafe.
......
......@@ -2004,14 +2004,12 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
// makeUnmarshalOneof makes an unmarshaler for oneof fields.
// for:
//
// message Msg {
// oneof F {
// int64 X = 1;
// float64 Y = 2;
// }
// }
//
// typ is the type of the concrete entry for a oneof case (e.g. Msg_X).
// ityp is the interface type of the oneof field (e.g. isMsg_F).
// unmarshal is the unmarshaler for the base type of the oneof case (e.g. int64).
......
......@@ -44,9 +44,9 @@ func (ps *pointerReferences) PushPair(vx, vy reflect.Value, d diffMode, deref bo
case diffUnknown, diffIdentical:
pp = [2]value.Pointer{value.PointerOf(vx), value.PointerOf(vy)}
case diffRemoved:
pp = [2]value.Pointer{value.PointerOf(vx), {}}
pp = [2]value.Pointer{value.PointerOf(vx), value.Pointer{}}
case diffInserted:
pp = [2]value.Pointer{{}, value.PointerOf(vy)}
pp = [2]value.Pointer{value.Pointer{}, value.PointerOf(vy)}
}
*ps = append(*ps, pp)
return pp
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build js
// +build js
package uuid
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !js
// +build !js
package uuid
......
......@@ -25,6 +25,7 @@ var jsonNull = []byte("null")
// } else {
// // NULL value
// }
//
type NullUUID struct {
UUID UUID
Valid bool // Valid is true if UUID is not NULL
......
......@@ -187,12 +187,10 @@ func Must(uuid UUID, err error) UUID {
}
// Validate returns an error if s is not a properly formatted UUID in one of the following formats:
//
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
//
// It returns an error if the format is invalid, otherwise nil.
func Validate(s string) error {
switch len(s) {
......
......@@ -135,18 +135,18 @@ func compile() {
for _, value := range irregularInflections {
infs := []inflection{
{regexp: regexp.MustCompile(strings.ToUpper(value.singular) + "$"), replace: strings.ToUpper(value.plural)},
{regexp: regexp.MustCompile(strings.Title(value.singular) + "$"), replace: strings.Title(value.plural)},
{regexp: regexp.MustCompile(value.singular + "$"), replace: value.plural},
inflection{regexp: regexp.MustCompile(strings.ToUpper(value.singular) + "$"), replace: strings.ToUpper(value.plural)},
inflection{regexp: regexp.MustCompile(strings.Title(value.singular) + "$"), replace: strings.Title(value.plural)},
inflection{regexp: regexp.MustCompile(value.singular + "$"), replace: value.plural},
}
compiledPluralMaps = append(compiledPluralMaps, infs...)
}
for _, value := range irregularInflections {
infs := []inflection{
{regexp: regexp.MustCompile(strings.ToUpper(value.plural) + "$"), replace: strings.ToUpper(value.singular)},
{regexp: regexp.MustCompile(strings.Title(value.plural) + "$"), replace: strings.Title(value.singular)},
{regexp: regexp.MustCompile(value.plural + "$"), replace: value.singular},
inflection{regexp: regexp.MustCompile(strings.ToUpper(value.plural) + "$"), replace: strings.ToUpper(value.singular)},
inflection{regexp: regexp.MustCompile(strings.Title(value.plural) + "$"), replace: strings.Title(value.singular)},
inflection{regexp: regexp.MustCompile(value.plural + "$"), replace: value.singular},
}
compiledSingularMaps = append(compiledSingularMaps, infs...)
}
......@@ -154,9 +154,9 @@ func compile() {
for i := len(pluralInflections) - 1; i >= 0; i-- {
value := pluralInflections[i]
infs := []inflection{
{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)},
{regexp: regexp.MustCompile(value.find), replace: value.replace},
{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace},
inflection{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)},
inflection{regexp: regexp.MustCompile(value.find), replace: value.replace},
inflection{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace},
}
compiledPluralMaps = append(compiledPluralMaps, infs...)
}
......@@ -164,9 +164,9 @@ func compile() {
for i := len(singularInflections) - 1; i >= 0; i-- {
value := singularInflections[i]
infs := []inflection{
{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)},
{regexp: regexp.MustCompile(value.find), replace: value.replace},
{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace},
inflection{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)},
inflection{regexp: regexp.MustCompile(value.find), replace: value.replace},
inflection{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace},
}
compiledSingularMaps = append(compiledSingularMaps, infs...)
}
......
......@@ -7,7 +7,7 @@ Installation
go get github.com/mattn/go-sqlite3
# Supported Types
Supported Types
Currently, go-sqlite3 supports the following data types.
......@@ -24,7 +24,7 @@ Currently, go-sqlite3 supports the following data types.
|time.Time | timestamp/datetime|
+------------------------------+
# SQLite3 Extension
SQLite3 Extension
You can write your own extension module for sqlite3. For example, below is an
extension for a Regexp matcher operation.
......@@ -77,7 +77,7 @@ Then, you can use this extension.
rows, err := db.Query("select text from mytable where name regexp '^golang'")
# Connection Hook
Connection Hook
You can hook and inject your code when the connection is established by setting
ConnectHook to get the SQLiteConn.
......@@ -101,7 +101,7 @@ You can also use database/sql.Conn.Raw (Go >= 1.13):
})
// if err != nil { ... }
# Go SQlite3 Extensions
Go SQlite3 Extensions
If you want to register Go functions as SQLite extension functions
you can make a custom driver by calling RegisterFunction from
......@@ -130,5 +130,6 @@ You can then use the custom driver by passing its name to sql.Open.
}
See the documentation of RegisterFunc for more details.
*/
package sqlite3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment