Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for UnmarshalerAttr (0.32 sec)

  1. src/encoding/xml/read.go

    		// so it's likely to be incorrect, but we do what we're told.
    		return val.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr)
    	}
    	if val.CanAddr() {
    		pv := val.Addr()
    		if pv.CanInterface() && pv.Type().Implements(unmarshalerAttrType) {
    			return pv.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr)
    		}
    	}
    
    	// Not an UnmarshalerAttr; try encoding.TextUnmarshaler.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 22.4K bytes
    - Viewed (0)
  2. src/encoding/xml/read_test.go

    	panic("must not call")
    }
    
    type MyAttr struct {
    	attr string
    }
    
    func (m *MyAttr) UnmarshalXMLAttr(attr Attr) error {
    	m.attr = attr.Value
    	return nil
    }
    
    var _ UnmarshalerAttr = (*MyAttr)(nil)
    
    type MyStruct struct {
    	Data *MyCharData
    	Attr *MyAttr `xml:",attr"`
    
    	Data2 MyCharData
    	Attr2 MyAttr `xml:",attr"`
    }
    
    func TestUnmarshaler(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 29.1K bytes
    - Viewed (0)
Back to top