shared-interface.snap•772 B
---
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 1
At: L33:C12
6|func AnotherConsumer() {
...
28| custom := &CustomImplementor{
29| SharedStruct: *s,
30| }
31|
32| // Custom type implements SharedInterface through embedding
33| var iface SharedInterface = custom
34| iface.Process()
35|
36| // Use shared type as a slice type
37| values := []SharedType{1, 2, 3}
38| for _, v := range values {
---
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
At: L23:C12
6|func ConsumerFunction() {
...
18| // Call methods on the struct
19| fmt.Println(s.Method())
20| s.Process()
21|
22| // Use shared interface
23| var iface SharedInterface = s
24| fmt.Println(iface.GetName())
25|
26| // Use shared type
27| var t SharedType = 100
28| fmt.Println(t)