$65 GRAYBYTE WORDPRESS FILE MANAGER $52

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 147.79.69.117 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/go/pkg/mod/gopkg.in/yaml.v2@v2.4.0/

HOME
Current File : /opt/go/pkg/mod/gopkg.in/yaml.v2@v2.4.0//example_embedded_test.go
package yaml_test

import (
	"fmt"
	"log"

	"gopkg.in/yaml.v2"
)

// An example showing how to unmarshal embedded
// structs from YAML.

type StructA struct {
	A string `yaml:"a"`
}

type StructB struct {
	// Embedded structs are not treated as embedded in YAML by default. To do that,
	// add the ",inline" annotation below
	StructA `yaml:",inline"`
	B       string `yaml:"b"`
}

var data = `
a: a string from struct A
b: a string from struct B
`

func ExampleUnmarshal_embedded() {
	var b StructB

	err := yaml.Unmarshal([]byte(data), &b)
	if err != nil {
		log.Fatalf("cannot unmarshal data: %v", err)
	}
	fmt.Println(b.A)
	fmt.Println(b.B)
	// Output:
	// a string from struct A
	// a string from struct B
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 Jan 2024 4.43 PM
root / root
0755
.travis.yml
0.218 KB
25 Jan 2024 4.43 PM
root / root
0444
LICENSE
11.091 KB
25 Jan 2024 4.43 PM
root / root
0444
LICENSE.libyaml
1.282 KB
25 Jan 2024 4.43 PM
root / root
0444
NOTICE
0.547 KB
25 Jan 2024 4.43 PM
root / root
0444
README.md
2.632 KB
25 Jan 2024 4.43 PM
root / root
0444
apic.go
20.782 KB
25 Jan 2024 4.43 PM
root / root
0444
decode.go
19.54 KB
25 Jan 2024 4.43 PM
root / root
0444
decode_test.go
31.081 KB
25 Jan 2024 4.43 PM
root / root
0444
emitterc.go
44.269 KB
25 Jan 2024 4.43 PM
root / root
0444
encode.go
9.582 KB
25 Jan 2024 4.43 PM
root / root
0444
encode_test.go
12.648 KB
25 Jan 2024 4.43 PM
root / root
0444
example_embedded_test.go
0.695 KB
25 Jan 2024 4.43 PM
root / root
0444
go.mod
0.093 KB
25 Jan 2024 4.43 PM
root / root
0444
limit_test.go
3.784 KB
25 Jan 2024 4.43 PM
root / root
0444
parserc.go
33.946 KB
25 Jan 2024 4.43 PM
root / root
0444
readerc.go
12.621 KB
25 Jan 2024 4.43 PM
root / root
0444
resolve.go
6.728 KB
25 Jan 2024 4.43 PM
root / root
0444
scannerc.go
75.775 KB
25 Jan 2024 4.43 PM
root / root
0444
sorter.go
2.579 KB
25 Jan 2024 4.43 PM
root / root
0444
suite_test.go
0.14 KB
25 Jan 2024 4.43 PM
root / root
0444
writerc.go
0.652 KB
25 Jan 2024 4.43 PM
root / root
0444
yaml.go
13.56 KB
25 Jan 2024 4.43 PM
root / root
0444
yamlh.go
25.563 KB
25 Jan 2024 4.43 PM
root / root
0444
yamlprivateh.go
4.845 KB
25 Jan 2024 4.43 PM
root / root
0444

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF