Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion staticcheck/fakexml/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ func (e *Encoder) marshalStruct(tinfo *typeInfo, val fakereflect.TypeAndCanAddr,
continue
}
}
continue

case fComment:
vf = indirect(vf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ type Recursive struct {
Field *Recursive
}

type UnsupportedCharData struct {
Field chan int `xml:",chardata"`
}

type UnsupportedCDATA struct {
Field func() `xml:",cdata"`
}

type ValueMarshaler chan int

func (ValueMarshaler) MarshalText() ([]byte, error) { return nil, nil }
Expand Down Expand Up @@ -316,6 +324,11 @@ func cyclicPointer() {
xml.Marshal(s) //@ diag(`cyclic type P, via x.Foo.Bar`)
}

func unsupportedTextFields() {
xml.Marshal(UnsupportedCharData{}) //@ diag(`unsupported type chan int`)
xml.Marshal(UnsupportedCDATA{}) //@ diag(`unsupported type func()`)
}

func functionAsArgument(arg T1) {
// https://staticcheck.io/issues/1660

Expand Down