1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

go fmt fixes

This commit is contained in:
Harvey Kandola 2017-12-11 09:47:37 +00:00
parent c5c988709d
commit 6cc78f76da
3 changed files with 8 additions and 18 deletions

View file

@ -16,10 +16,8 @@ import (
)
// Numberize calculates numbers for pages, e.g. 1, 1.1, 2.2.1
// that form a document's Table of Contents.
//
// for the document's Table of Contents.
func Numberize(pages []Page) {
// index := 1
var prevPageLevel uint64
parts := []int{1} // we store 1, 1, 2, and then generate numbering as "1.1.2"
@ -29,14 +27,6 @@ func Numberize(pages []Page) {
p.Level = 1
}
// increment level numbers each time we encounter age level of 1
// if p.Level == 1 {
// index++
// parts = []int{index}
// } else if p.Level == prevPageLevel {
// parts[len(parts)-1]++
// }
if i != 0 {
// we ...
if p.Level > prevPageLevel {

View file

@ -103,14 +103,14 @@ type NewPage struct {
Meta Meta `json:"meta"`
}
// PageSequenceRequest details a page ID and its sequence within the document.
type PageSequenceRequest struct {
// SequenceRequest details a page ID and its sequence within the document.
type SequenceRequest struct {
PageID string `json:"pageId"`
Sequence float64 `json:"sequence"`
}
// PageLevelRequest details a page ID and level.
type PageLevelRequest struct {
// LevelRequest details a page ID and level.
type LevelRequest struct {
PageID string `json:"pageId"`
Level int `json:"level"`
}