From 5c8bf1af5acd2e548a14c10317330b1d6ab941a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Thu, 23 Feb 2023 15:35:53 +0800 Subject: [PATCH] make lint happy --- README.md | 11 +---------- apilink.go | 1 + media.go | 1 + structdoc.go | 2 +- structdrawing.go | 2 ++ structrel.go | 2 +- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 978e3db..e9dd046 100644 --- a/README.md +++ b/README.md @@ -7,26 +7,17 @@ This is a variant optimized and expanded by fumiama. The original repo is [gonfv ## Introduction > As part of my work for [Basement Crowd](https://www.basementcrowd.com) and [FromCounsel](https://www.fromcounsel.com), we were in need of a basic library to manipulate (both read and write) Microsoft Word documents. - > The difference with other projects is the following: - > - [UniOffice](https://github.com/unidoc/unioffice) is probably the most complete but it is also commercial (you need to pay). It also very complete, but too much for my needs. - > - [gingfrederik/docx](https://github.com/gingfrederik/docx) only allows to write. - > There are also a couple of other projects [kingzbauer/docx](https://github.com/kingzbauer/docx) and [nguyenthenguyen/docx](https://github.com/nguyenthenguyen/docx) - > [gingfrederik/docx](https://github.com/gingfrederik/docx) was a heavy influence (the original structures and the main method come from that project). - > However, those original structures didn't handle reading and extending them was particularly difficult due to Go xml parser being a bit limited including a [6 year old bug](https://github.com/golang/go/issues/9519). - > Additionally, my requirements go beyond the original structure and a hard fork seemed more sensible. - > The plan is to evolve the library, so the API is likely to change according to my company's needs. But please do feel free to send patches, reports and PRs (or fork). - > In the mean time, shared as an example in case somebody finds it useful. -The Introduction above is copied from the original repo. I had evolved that repo again to fit my needs. Here is the supported functions now. +The Introduction above is copied from the original repo. I had evolved that repo again to fit my needs. Here are the supported functions now. - [x] parse and save document - [x] edit simple text (color, size, alignment, ...) diff --git a/apilink.go b/apilink.go index e33a8a9..19b66f6 100644 --- a/apilink.go +++ b/apilink.go @@ -1,5 +1,6 @@ package docxlib +//nolint:revive,stylecheck const ( HYPERLINK_STYLE = "a3" ) diff --git a/media.go b/media.go index 5e75511..7eff808 100644 --- a/media.go +++ b/media.go @@ -1,5 +1,6 @@ package docxlib +//nolint:revive,stylecheck const MEDIA_FOLDER = `word/media/` // Media is in word/media diff --git a/structdoc.go b/structdoc.go index 0fdf625..9ef0179 100644 --- a/structdoc.go +++ b/structdoc.go @@ -7,7 +7,7 @@ import ( "sync" ) -//nolint:revive +//nolint:revive,stylecheck const ( XMLNS_W = `http://schemas.openxmlformats.org/wordprocessingml/2006/main` XMLNS_R = `http://schemas.openxmlformats.org/officeDocument/2006/relationships` diff --git a/structdrawing.go b/structdrawing.go index 9560391..b4164d1 100644 --- a/structdrawing.go +++ b/structdrawing.go @@ -7,11 +7,13 @@ import ( "strings" ) +//nolint:revive,stylecheck const ( // A4_EMU_MAX_WIDTH is the max display width of an A4 paper A4_EMU_MAX_WIDTH = 5274310 ) +//nolint:revive,stylecheck const ( XMLNS_DRAWINGML_MAIN = `http://schemas.openxmlformats.org/drawingml/2006/main` XMLNS_DRAWINGML_PICTURE = `http://schemas.openxmlformats.org/drawingml/2006/picture` diff --git a/structrel.go b/structrel.go index 918bf0f..d37f87e 100644 --- a/structrel.go +++ b/structrel.go @@ -4,7 +4,7 @@ import ( "sync" ) -//nolint:revive +//nolint:revive,stylecheck const ( XMLNS_REL = `http://schemas.openxmlformats.org/package/2006/relationships` REL_HYPERLINK = `http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`