Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 526 Bytes

Error.md

File metadata and controls

34 lines (23 loc) · 526 Bytes

func (e *ParseError) Error() string

参数列表:

返回值:

  • 返回字符串

功能说明:

这个函数主要用来返回 ParseError 实例的具体错误信息。

代码实例:

package main

import (
	"encoding/csv"
	"fmt"
	"strings"
)

func main() {
	reader := csv.NewReader(strings.NewReader("cell10,cell11\ncell20"))
	_, err := reader.ReadAll()
	if err != nil {
		fmt.Println(err.Error())
	}
}

运行后,终端将输出 line 2, column 0: wrong number of fields in line .