Repository: zeromicro/go-zero (go)

Issue:
config file xxx, type mismatch for field "xxx", expect "string", actual "string"
**Describe the bug**
If the field "password" is configured as a string in config.go, when the field "password" is set to a pure number in config.yml, an error will be reported and exit

**To Reproduce**
1. The config.yml is
config.yml
   ```go
   password: 123456
   ```

2. The config.go is
config.go
   ```go
   type Config struct {
     Password   string   `json:"password"`
   }
   ```

3. The main.go is
main.go
   ```go
   func main() {
	var sc Config
	conf.MustLoad("etc/config.yml", &sc)
   }
   ```
4. The error is

   ```
   error: config file config.yml, type mismatch for field "password", expect "string", actual "string"
   ```

**Expected behavior**
The field "password" can be parsed correctly

**Screenshots**
![image](https://github.com/zeromicro/go-zero/assets/25501580/82de4621-fd5c-44e6-9c3e-2452173f94f9)


**Environments (please complete the following information):**
 - OS: windows10 ltsc
 - go-zero version v1.5.5
 - goctl version 1.5.5 windows/amd64

**More description**

config.yml
   ```go
   password: "123456"
   ```
The field "password" can be parsed correctly......


Pull request:
fix: unmarshal from number to string with incorrect error message
fix #3622 

Patch:
diff --git a/core/mapping/unmarshaler.go b/core/mapping/unmarshaler.go
index 8a9fbd61..15215693 100644
--- a/core/mapping/unmarshaler.go
+++ b/core/mapping/unmarshaler.go
@@ -19,9 +19,10 @@ import (
 )
 
 const (
-	defaultKeyName = "key"
-	delimiter      = '.'
-	ignoreKey      = "-"
+	defaultKeyName   = "key"
+	delimiter        = '.'
+	ignoreKey        = "-"
+	numberTypeString = "number"
 )
 
 var (
@@ -634,7 +635,7 @@ func (u *Unmarshaler) processFieldPrimitiveWithJSONNumber(fieldType reflect.Type
 
 		target.SetFloat(fValue)
 	default:
-		return newTypeMismatchErrorWithHint(fullName, typeKind.String(), value.Type().String())
+		return newTypeMismatchErrorWithHint(fullName, typeKind.String(), numberTypeString)
 	}
 
 	SetValue(fieldType, value, target)


Test patch:
diff --git a/core/mapping/unmarshaler_test.go b/core/mapping/unmarshaler_test.go
index 2ac19aa4..fd02fd6d 100644
--- a/core/mapping/unmarshaler_test.go
+++ b/core/mapping/unmarshaler_test.go
@@ -5490,7 +5490,7 @@ func TestUnmarshalerProcessFieldPrimitiveWithJSONNumber(t *testing.T) {
 		err := m.processFieldPrimitiveWithJSONNumber(fieldType, value.Elem(), v,
 			&fieldOptionsWithContext{}, "field")
 		assert.Error(t, err)
-		assert.Equal(t, `type mismatch for field "field", expect "string", actual "int"`, err.Error())
+		assert.Equal(t, `type mismatch for field "field", expect "string", actual "number"`, err.Error())
 	})
 
 	t.Run("right type", func(t *testing.T) {
diff --git a/core/mapping/yamlunmarshaler_test.go b/core/mapping/yamlunmarshaler_test.go
index eef849ac..a9854b89 100644
--- a/core/mapping/yamlunmarshaler_test.go
+++ b/core/mapping/yamlunmarshaler_test.go
@@ -1011,6 +1011,15 @@ func TestUnmarshalYamlMapRune(t *testing.T) {
 	assert.Equal(t, rune(3), v.Machine["node3"])
 }
 
+func TestUnmarshalYamlStringOfInt(t *testing.T) {
+	text := `password: 123456`
+	var v struct {
+		Password string `json:"password"`
+	}
+	reader := strings.NewReader(text)
+	assert.Error(t, UnmarshalYamlReader(reader, &v))
+}
+
 func TestUnmarshalYamlBadInput(t *testing.T) {
 	var v struct {
 		Any string