Prechádzať zdrojové kódy

codec: update that mid-stack linling is expected in go 1.11 development cycle

Ugorji Nwoke 7 rokov pred
rodič
commit
97ffc5827b
4 zmenil súbory, kde vykonal 9 pridanie a 8 odobranie
  1. 1 1
      codec/0doc.go
  2. 2 2
      codec/decode.go
  3. 2 2
      codec/encode.go
  4. 4 3
      codec/json.go

+ 1 - 1
codec/0doc.go

@@ -225,7 +225,7 @@ with some caveats. See Encode documentation.
 package codec
 
 // TODO:
-//   - In Go 1.10, when mid-stack inlining is enabled,
+//   - For Go 1.11, when mid-stack inlining is enabled,
 //     we should use committed functions for writeXXX and readXXX calls.
 //     This involves uncommenting the methods for decReaderSwitch and encWriterSwitch
 //     and using those (decReaderSwitch and encWriterSwitch) in all handles

+ 2 - 2
codec/decode.go

@@ -1237,7 +1237,7 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) {
 	// This way, the order can be kept (as order is lost with map).
 	ti := f.ti
 	if f.seq == seqTypeChan && ti.chandir&uint8(reflect.SendDir) == 0 {
-		d.errorf("receive-only channel cannot be used for sending byte(s)")
+		d.errorf("receive-only channel cannot be decoded")
 	}
 	dd := d.d
 	rtelem0 := ti.elem
@@ -1734,7 +1734,7 @@ type decReaderSwitch struct {
 	esep  bool // has elem separators
 }
 
-// TODO: Uncomment after mid-stack inlining enabled in go 1.10
+// TODO: Uncomment after mid-stack inlining enabled in go 1.11
 //
 // func (z *decReaderSwitch) unreadn1() {
 // 	if z.bytes {

+ 2 - 2
codec/encode.go

@@ -314,7 +314,7 @@ func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) {
 		}
 	}
 	if f.seq == seqTypeChan && ti.chandir&uint8(reflect.RecvDir) == 0 {
-		e.errorf("send-only channel cannot be used for receiving byte(s)")
+		e.errorf("send-only channel cannot be encoded")
 	}
 	elemsep := e.esep
 	l := rv.Len()
@@ -837,7 +837,7 @@ type encWriterSwitch struct {
 	isas bool // whether e.as != nil
 }
 
-// // TODO: Uncomment after mid-stack inlining enabled in go 1.10
+// // TODO: Uncomment after mid-stack inlining enabled in go 1.11
 
 // func (z *encWriterSwitch) writeb(s []byte) {
 // 	if z.wx {

+ 4 - 3
codec/json.go

@@ -638,9 +638,10 @@ func (d *jsonDecDriver) CheckBreak() bool {
 // - ReadArrayElem would become:
 //   readContainerState(containerArrayElem, ',', d.c != containerArrayStart)
 //
-// However, until mid-stack inlining (go 1.10?) comes, supporting inlining of
-// oneliners, we explicitly write them all 5 out to elide the extra func call.
-// TODO: For Go 1.10, if inlined, consider consolidating these.
+// However, until mid-stack inlining comes in go1.11 which supports inlining of
+// one-liners, we explicitly write them all 5 out to elide the extra func call.
+//
+// TODO: For Go 1.11, if inlined, consider consolidating these.
 
 func (d *jsonDecDriver) ReadArrayElem() {
 	const xc uint8 = ','