From 96fd8cf3f6c6c1f21cd8c6060581629f0b56b8a3 Mon Sep 17 00:00:00 2001
From: Martin Dosch
Date: Fri, 30 Aug 2019 09:44:03 +0200
Subject: [PATCH] Revert "Updated vendor packages."
This reverts commit 3d981156fef78b34b61c0a97be12d6b5f62e8b41.
---
vendor/github.com/chilts/sid/ReadMe.md | 14 +-
vendor/github.com/chilts/sid/go.mod | 3 -
vendor/github.com/chilts/sid/sid.go | 93 +--
.../olekukonko/tablewriter/README.md | 2 +-
.../github.com/olekukonko/tablewriter/go.mod | 8 -
.../github.com/olekukonko/tablewriter/go.sum | 4 -
.../olekukonko/tablewriter/table.go | 4 +-
vendor/jaytaylor.com/html2text/LICENSE | 22 +
vendor/jaytaylor.com/html2text/README.md | 137 +++++
vendor/jaytaylor.com/html2text/html2text.go | 535 ++++++++++++++++++
vendor/vendor.json | 92 +--
11 files changed, 754 insertions(+), 160 deletions(-)
delete mode 100644 vendor/github.com/chilts/sid/go.mod
delete mode 100644 vendor/github.com/olekukonko/tablewriter/go.mod
delete mode 100644 vendor/github.com/olekukonko/tablewriter/go.sum
create mode 100644 vendor/jaytaylor.com/html2text/LICENSE
create mode 100644 vendor/jaytaylor.com/html2text/README.md
create mode 100644 vendor/jaytaylor.com/html2text/html2text.go
diff --git a/vendor/github.com/chilts/sid/ReadMe.md b/vendor/github.com/chilts/sid/ReadMe.md
index 7761928..b4653cb 100644
--- a/vendor/github.com/chilts/sid/ReadMe.md
+++ b/vendor/github.com/chilts/sid/ReadMe.md
@@ -20,19 +20,13 @@ go get github.com/chilts/sid
```
id1 := sid.Id()
-id2 := sid.IdHex()
-id3 := sid.IdBase32()
-id4 := sid.IdBase64()
+id2 := sid.Id()
fmt.Printf("id1 = %s\n", id1)
fmt.Printf("id2 = %s\n", id2)
-fmt.Printf("id3 = %s\n", id3)
-fmt.Printf("id4 = %s\n", id4)
-// -> "id1 = 1559872035903071353-1186579057231285506"
-// -> "id2 = 15a5cf57e7d2a837-6eaafe687e7b3ec3"
-// -> "id3 = 1b9efqnl51jj7-4u66ikpfq9ugm"
-// -> "id4 = 1IeSBAWW9kK-0cDG64GQgGJ"
+// -> "id1 = 1IeSBAWW83j-2wgJ4PUtlAr"
+// -> "id2 = 1IeSBAWW9kK-0cDG64GQgGJ"
```
## Author
@@ -43,6 +37,6 @@ For [AppsAttic](https://appsattic.com/), [@AppsAttic](https://twitter.com/AppsAt
## License
-[MIT](https://chilts.mit-license.org/2017/)
+[MIT](https://publish.li/mit-qLQqmVTO).
(Ends)
diff --git a/vendor/github.com/chilts/sid/go.mod b/vendor/github.com/chilts/sid/go.mod
deleted file mode 100644
index fbe38d8..0000000
--- a/vendor/github.com/chilts/sid/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module github.com/chilts/sid
-
-go 1.12
diff --git a/vendor/github.com/chilts/sid/sid.go b/vendor/github.com/chilts/sid/sid.go
index d3b55e3..7c1f2c8 100644
--- a/vendor/github.com/chilts/sid/sid.go
+++ b/vendor/github.com/chilts/sid/sid.go
@@ -12,7 +12,6 @@
package sid
import (
- "fmt"
"math/rand"
"strconv"
"strings"
@@ -33,39 +32,17 @@ var chars = make([]string, 11, 11)
// 64 chars but ordered by ASCII
const base64 string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~"
-func toStr(n int64) string {
+func toStr(now int64) string {
// now do the generation (backwards, so we just %64 then /64 along the way)
for i := 10; i >= 0; i-- {
- index := n % 64
+ index := now % 64
chars[i] = string(base64[index])
- n = n / 64
+ now = now / 64
}
return strings.Join(chars, "")
}
-func toBase32(n int64) string {
- b32 := strconv.FormatInt(n, 32)
-
- for len(b32) < 13 {
- b32 = "0" + b32
- }
-
- // log.Printf("b32=%s\n", b32)
-
- return b32
-}
-
-func toHex(n int64) string {
- hex := fmt.Sprintf("%x", n)
-
- for len(hex) < 16 {
- hex = "0" + hex
- }
-
- return hex
-}
-
// IdBase64 returns a 23 char string based on timestamp and a random number. The format is "XXXXXXXXXXX-YYYYYYYYYYY"
// where X is the timestamp and Y is the random number. If (by any chance) this is called in the same nanosecond, the
// random number is incremented instead of a new one being generated. This makes sure that two consecutive Ids
@@ -94,66 +71,10 @@ func IdBase64() string {
return toStr(now) + "-" + toStr(r)
}
-// IdBase32 returns a 27 char string based on timestamp and a random number. The format is
-// "XXXXXXXXXXXXX-YYYYYYYYYYYYY" where X is the timestamp and Y is the random number. If (by any chance) this is called
-// in the same nanosecond, the random number is incremented instead of a new one being generated. This makes sure that
-// two consecutive Ids generated in the same goroutine also ensure those Ids are also sortable.
-//
-// It is safe to call from different goroutines since it has it's own locking.
-func IdBase32() string {
- // lock for lastTime, lastRand, and chars
- mu.Lock()
- defer mu.Unlock()
-
- now := time.Now().UTC().UnixNano()
- var r int64
-
- // if we have the same time, just inc lastRand, else create a new one
- if now == lastTime {
- lastRand++
- } else {
- lastRand = rand.Int63()
- }
- r = lastRand
-
- // remember this for next time
- lastTime = now
-
- return toBase32(now) + "-" + toBase32(r)
-}
-
-// IdHex returns a char string based on timestamp and a random number. The format is
-// "XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY" where X is the timestamp and Y is the random number. If (by any chance) this is
-// called in the same nanosecond, the random number is incremented instead of a new one being generated. This makes
-// sure that two consecutive Ids generated in the same goroutine also ensure those Ids are also sortable.
-//
-// It is safe to call from different goroutines since it has it's own locking.
-func IdHex() string {
- // lock for lastTime, lastRand, and chars
- mu.Lock()
- defer mu.Unlock()
-
- now := time.Now().UTC().UnixNano()
- var r int64
-
- // if we have the same time, just inc lastRand, else create a new one
- if now == lastTime {
- lastRand++
- } else {
- lastRand = rand.Int63()
- }
- r = lastRand
-
- // remember this for next time
- lastTime = now
-
- return toHex(now) + "-" + toHex(r)
-}
-
-// Id returns a 39 char string based on timestamp and a random number. The format is
-// "XXXXXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYYYYY" where X is the timestamp and Y is the random number. If (by any chance)
-// this is called in the same nanosecond, the random number is incremented instead of a new one being generated. This
-// makes sure that two consecutive Ids generated in the same goroutine also ensure those Ids are also sortable.
+// Id returns a 23 char string based on timestamp and a random number. The format is "XXXXXXXXXXX-YYYYYYYYYYY" where X
+// is the timestamp and Y is the random number. If (by any chance) this is called in the same nanosecond, the random
+// number is incremented instead of a new one being generated. This makes sure that two consecutive Ids generated in
+// the same goroutine also ensure those Ids are also sortable.
//
// It is safe to call from different goroutines since it has it's own locking.
func Id() string {
diff --git a/vendor/github.com/olekukonko/tablewriter/README.md b/vendor/github.com/olekukonko/tablewriter/README.md
index cb5e137..92d71ed 100644
--- a/vendor/github.com/olekukonko/tablewriter/README.md
+++ b/vendor/github.com/olekukonko/tablewriter/README.md
@@ -283,7 +283,7 @@ import (
func main() {
tableString := &strings.Builder{}
- table := tablewriter.NewWriter(tableString)
+ table := tablewriter.NewWriter(tableString)
/*
* Code to fill the table
diff --git a/vendor/github.com/olekukonko/tablewriter/go.mod b/vendor/github.com/olekukonko/tablewriter/go.mod
deleted file mode 100644
index 84b405d..0000000
--- a/vendor/github.com/olekukonko/tablewriter/go.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-module github.com/olekukonko/tablewriter
-
-go 1.12
-
-require (
- github.com/mattn/go-runewidth v0.0.4
- github.com/olekukonko/tablewriter v0.0.1
-)
diff --git a/vendor/github.com/olekukonko/tablewriter/go.sum b/vendor/github.com/olekukonko/tablewriter/go.sum
deleted file mode 100644
index 9d5e335..0000000
--- a/vendor/github.com/olekukonko/tablewriter/go.sum
+++ /dev/null
@@ -1,4 +0,0 @@
-github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
-github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
-github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
diff --git a/vendor/github.com/olekukonko/tablewriter/table.go b/vendor/github.com/olekukonko/tablewriter/table.go
index 06341bc..3cf0996 100644
--- a/vendor/github.com/olekukonko/tablewriter/table.go
+++ b/vendor/github.com/olekukonko/tablewriter/table.go
@@ -766,7 +766,7 @@ func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx
if t.autoMergeCells {
//Store the full line to merge mutli-lines cells
- fullLine := strings.TrimRight(strings.Join(columns[y], " "), " ")
+ fullLine := strings.Join(columns[y], " ")
if len(previousLine) > y && fullLine == previousLine[y] && fullLine != "" {
// If this cell is identical to the one above but not empty, we don't display the border and keep the cell empty.
displayCellBorder = append(displayCellBorder, false)
@@ -804,7 +804,7 @@ func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx
//The new previous line is the current one
previousLine = make([]string, total)
for y := 0; y < total; y++ {
- previousLine[y] = strings.TrimRight(strings.Join(columns[y], " ")," ") //Store the full line for multi-lines cells
+ previousLine[y] = strings.Join(columns[y], " ") //Store the full line for multi-lines cells
}
//Returns the newly added line and wether or not a border should be displayed above.
return previousLine, displayCellBorder
diff --git a/vendor/jaytaylor.com/html2text/LICENSE b/vendor/jaytaylor.com/html2text/LICENSE
new file mode 100644
index 0000000..24dc4ab
--- /dev/null
+++ b/vendor/jaytaylor.com/html2text/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Jay Taylor
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/vendor/jaytaylor.com/html2text/README.md b/vendor/jaytaylor.com/html2text/README.md
new file mode 100644
index 0000000..6b2494e
--- /dev/null
+++ b/vendor/jaytaylor.com/html2text/README.md
@@ -0,0 +1,137 @@
+# html2text
+
+[![Documentation](https://godoc.org/github.com/jaytaylor/html2text?status.svg)](https://godoc.org/github.com/jaytaylor/html2text)
+[![Build Status](https://travis-ci.org/jaytaylor/html2text.svg?branch=master)](https://travis-ci.org/jaytaylor/html2text)
+[![Report Card](https://goreportcard.com/badge/github.com/jaytaylor/html2text)](https://goreportcard.com/report/github.com/jaytaylor/html2text)
+
+### Converts HTML into text of the markdown-flavored variety
+
+
+## Introduction
+
+Ensure your emails are readable by all!
+
+Turns HTML into raw text, useful for sending fancy HTML emails with an equivalently nicely formatted TXT document as a fallback (e.g. for people who don't allow HTML emails or have other display issues).
+
+html2text is a simple golang package for rendering HTML into plaintext.
+
+There are still lots of improvements to be had, but FWIW this has worked fine for my [basic] HTML-2-text needs.
+
+It requires go 1.x or newer ;)
+
+
+## Download the package
+
+```bash
+go get jaytaylor.com/html2text
+```
+
+## Example usage
+
+```go
+package main
+
+import (
+ "fmt"
+
+ "jaytaylor.com/html2text"
+)
+
+func main() {
+ inputHTML := `
+
+
+ My Mega Service
+
+
+
+
+
+