Skip to content

Commit

Permalink
feat: update test to new vanity URL
Browse files Browse the repository at this point in the history
  • Loading branch information
darccio committed Jun 20, 2023
1 parent a5b2cb8 commit e6e9dec
Show file tree
Hide file tree
Showing 38 changed files with 62 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ name = "go"
enabled = true

[analyzers.meta]
import_path = "github.com/imdario/mergo"
import_path = "dario.cat/mergo"
43 changes: 24 additions & 19 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,36 @@ A helper to merge structs and maps in Golang. Useful for configuration default v
Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection).
Status
# Status
It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc.
Important note
# Important notes
1.0.0
In 1.0.0 Mergo moves to a vanity URL `dario.cat/mergo`.
0.3.9
Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules.
Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code.
If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u github.com/imdario/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0).
If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u dario.cat/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0).
Install
# Install
Do your usual installation procedure:
go get github.com/imdario/mergo
go get dario.cat/mergo
// use in your .go code
import (
"github.com/imdario/mergo"
)
// use in your .go code
import (
"dario.cat/mergo"
)
Usage
# Usage
You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
Expand Down Expand Up @@ -59,7 +65,7 @@ Here is a nice example:
import (
"fmt"
"github.com/imdario/mergo"
"dario.cat/mergo"
)
type Foo struct {
Expand All @@ -81,17 +87,17 @@ Here is a nice example:
// {two 2}
}
Transformers
# Transformers
Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time?
package main
import (
"fmt"
"github.com/imdario/mergo"
"reflect"
"time"
"dario.cat/mergo"
"reflect"
"time"
)
type timeTransformer struct {
Expand Down Expand Up @@ -127,17 +133,16 @@ Transformers allow to merge specific types differently than in the default behav
// { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 }
}
Contact me
# Contact me
If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): https://twitter.com/im_dario
About
# About
Written by Dario Castañé: https://da.rio.hn
License
# License
BSD 3-Clause license, as Go language.
*/
package mergo
2 changes: 1 addition & 1 deletion issue100_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type issue100s struct {
Expand Down
2 changes: 1 addition & 1 deletion issue104_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type Record struct {
Expand Down
2 changes: 1 addition & 1 deletion issue121_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue121WithSliceDeepCopy(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue123_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue123(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue125_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type settings struct {
Expand Down
2 changes: 1 addition & 1 deletion issue129_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue129Boolean(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue131_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type foz struct {
Expand Down
2 changes: 1 addition & 1 deletion issue136_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type embeddedTestA struct {
Expand Down
2 changes: 1 addition & 1 deletion issue138_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

const issue138configuration string = `
Expand Down
2 changes: 1 addition & 1 deletion issue143_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue143(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue149_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type user struct {
Expand Down
2 changes: 1 addition & 1 deletion issue174_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type structWithBlankField struct {
Expand Down
2 changes: 1 addition & 1 deletion issue17_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue17MergeWithOverwrite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue202_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue202(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue209_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue209(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue220_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue220(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue230_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

var testDataM = []struct {
Expand Down
2 changes: 1 addition & 1 deletion issue23_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type document struct {
Expand Down
2 changes: 1 addition & 1 deletion issue33_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type Foo struct {
Expand Down
2 changes: 1 addition & 1 deletion issue38_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type structWithoutTimePointer struct {
Expand Down
2 changes: 1 addition & 1 deletion issue50_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type testStruct struct {
Expand Down
2 changes: 1 addition & 1 deletion issue52_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type structWithTime struct {
Expand Down
2 changes: 1 addition & 1 deletion issue61_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue61MergeNilMap(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion issue64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type Student struct {
Expand Down
2 changes: 1 addition & 1 deletion issue66_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type PrivateSliceTest66 struct {
Expand Down
2 changes: 1 addition & 1 deletion issue83_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type issue83My struct {
Expand Down
2 changes: 1 addition & 1 deletion issue84_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type DstStructIssue84 struct {
Expand Down
2 changes: 1 addition & 1 deletion issue89_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

func TestIssue89Boolean(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion issue90_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package mergo_test

import (
"github.com/imdario/mergo"
"reflect"
"testing"

"dario.cat/mergo"
)

type structWithStringMap struct {
Expand Down
2 changes: 1 addition & 1 deletion issueXXX_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mergo_test
import (
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

var testDataS = []struct {
Expand Down
2 changes: 1 addition & 1 deletion merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/imdario/mergo"
"dario.cat/mergo"
)

type transformer struct {
Expand Down
2 changes: 1 addition & 1 deletion mergo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/imdario/mergo"
"dario.cat/mergo"
"gopkg.in/yaml.v3"
)

Expand Down
Loading

0 comments on commit e6e9dec

Please sign in to comment.