Compare commits

..

No commits in common. "master" and "1.1.1" have entirely different histories.

8 changed files with 11 additions and 15 deletions

View File

@ -1,5 +1,5 @@
[![Go Report Card](https://goreportcard.com/badge/git.webz.asia/go-convert/fields)](https://goreportcard.com/report/git.webz.asia/go-convert/fields) [![Go Report Card](https://goreportcard.com/badge/github.com/go-convert/fields)](https://goreportcard.com/report/github.com/go-convert/fields)
[![Actions Status](https://git.webz.asia/go-convert/fields/workflows/Go/badge.svg)](https://git.webz.asia/go-convert/fields/actions) [![Actions Status](https://github.com/go-convert/fields/workflows/Go/badge.svg)](https://github.com/go-convert/fields/actions)
[![Build Status](https://travis-ci.org/go-convert/fields.svg?branch=master)](https://travis-ci.org/go-convert/fields) [![Build Status](https://travis-ci.org/go-convert/fields.svg?branch=master)](https://travis-ci.org/go-convert/fields)
[![codecov](https://codecov.io/gh/go-convert/fields/branch/master/graph/badge.svg)](https://codecov.io/gh/go-convert/fields) [![codecov](https://codecov.io/gh/go-convert/fields/branch/master/graph/badge.svg)](https://codecov.io/gh/go-convert/fields)
@ -15,7 +15,7 @@ import (
"log" "log"
"encoding/json" "encoding/json"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
) )
type FromStruct struct { type FromStruct struct {
@ -80,7 +80,7 @@ import (
"log" "log"
"encoding/json" "encoding/json"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
) )
type FromStructCustom struct { type FromStructCustom struct {

View File

@ -25,7 +25,7 @@ import (
"encoding/json" "encoding/json"
"log" "log"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
) )
type fromStruct struct { type fromStruct struct {

View File

@ -25,7 +25,7 @@ import (
"encoding/json" "encoding/json"
"log" "log"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
) )
type fromStructCustom struct { type fromStructCustom struct {

View File

@ -25,7 +25,7 @@ import (
"encoding/json" "encoding/json"
"log" "log"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
) )
type FromStructBase struct { type FromStructBase struct {

View File

@ -25,7 +25,7 @@ import (
"encoding/json" "encoding/json"
"log" "log"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
"github.com/satori/go.uuid" "github.com/satori/go.uuid"
) )

View File

@ -84,11 +84,7 @@ func Сonvert(from interface{}, kind string, to interface{}) {
switch f.Type.String() { switch f.Type.String() {
case "uuid.UUID": case "uuid.UUID":
mv := fv.Interface().(uuid.UUID) mv := fv.Interface().(uuid.UUID)
if ft.Type().String() == "uuid.UUID" {
ft.Set(fv)
} else {
ft.SetString(mv.String()) ft.SetString(mv.String())
}
default: default:
ft.Set(fv) ft.Set(fv)
} }

View File

@ -27,7 +27,7 @@ import (
"github.com/satori/go.uuid" "github.com/satori/go.uuid"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"git.webz.asia/go-convert/fields" "github.com/go-convert/fields"
) )
type FromStruct struct { type FromStruct struct {

2
go.mod
View File

@ -1,4 +1,4 @@
module git.webz.asia/go-convert/fields module github.com/go-convert/fields
go 1.13 go 1.13