1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/chaos.su-go-toml

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
position.go 738
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
eanderton Отправлено 15.09.2014 04:26 d9de45b
// Position support for go-toml
package toml
import (
"fmt"
)
/*
Position of a document element within a TOML document.
Line and Col are both 1-indexed positions for the element's line number and
column number, respectively. Values of zero or less will cause Invalid(),
to return true.
*/
type Position struct {
Line int // line within the document
Col int // column within the line
}
// String representation of the position.
// Displays 1-indexed line and column numbers.
func (p *Position) String() string {
return fmt.Sprintf("(%d, %d)", p.Line, p.Col)
}
// Returns whether or not the position is valid (i.e. with negative or
// null values)
func (p *Position) Invalid() bool {
return p.Line <= 0 || p.Col <= 0
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/chaos.su-go-toml.git
git@api.gitlife.ru:oschina-mirror/chaos.su-go-toml.git
oschina-mirror
chaos.su-go-toml
chaos.su-go-toml
orderedkeys