35 Commits

Author SHA1 Message Date
Alexandr Mayorskiy 8ab5ff9cd8 fix parser for go 1.15 (multiline comments) 2020-08-12 14:42:29 +03:00
Alexandr Mayorskiy f3f97e8f15 fix parser for go 1.15 (#304)
* fix parser for go 1.15
2020-08-12 14:22:55 +03:00
Pavel Parshin 0c9f71dfd2 Fixed skip detection and added correct test 2020-05-10 14:08:06 +03:00
Pavel Parshin e25e66fa75 Added pragma easyjson:skip to exclude structs from generating stage
It allows manually control which struct should be skipped when using option `-all`.
2020-05-10 13:34:43 +03:00
Alexandr Mayorskiy dfc0280759 fix import order 2020-04-12 17:44:20 +03:00
Alexandr Mayorskiy 7af8f522e8 Merge branch 'default_gopath' of git://github.com/stek29/easyjson into stek29-default_gopath 2020-04-12 17:41:58 +03:00
GoWebProd 2d0de5a8b6 Merge branch 'master' into patch/typespec-docs 2020-03-30 23:27:08 +03:00
GoWebProd 1b67345d79 Merge pull request #218 from bobappleyard/master
Issue #217: handling of _test.go files
2020-03-30 23:19:08 +03:00
GoWebProd 38878c99bb Merge pull request #263 from zifter/master
Windows only issue - mismatch in volume letter
2020-03-30 23:09:22 +03:00
GoWebProd 0af7b1cb90 Merge branch 'master' into fix-gomod-concurrency 2020-03-30 23:02:18 +03:00
Ivan Boyarkin 237a098526 parser: Fix go.mod endline comments parsing
It's required because:
- go.mod file can contain comments
- easyjson should respect comments and be able to parse go.mod

This commit replaces the logic of parsing go.mod file with the original
one from golang.org/x/mod/modfile package. Tests have been
introduced to check the behavior of `getModulePath` function.

Ref:
- https://golang.org/cmd/go/#hdr-The_go_mod_file
2020-03-02 16:35:04 +01:00
Oleg Strokachuk 1c38a191ce Windows only issue:
Fix case when file is located in gopath but they have different volume letter. For example:
Error parsing fast.go: file 'E:\!project\go\src\coursera\hw3_bench\fast.go' is not in GOPATH 'e:\!project\go\'

1) filepath.Rel takes care about that;
2) add gopath variable to error
2020-01-30 16:12:59 +03:00
Kenneth Shaw baa893c8f6 Fixes a concurrency issue with go module package path cache
The `chromedp-gen` tool, which makes use of the raw code, always
encounters issues with slow builds. This adds a simple `sync.RWMutex` to
the Go module map package path cache variable that's causing problems.
2019-10-03 07:30:27 +07:00
rappleyard_depoel 24b3ef1d37 Issue #217: handling of _test.go files
If a directory is passed to the command line tool, the directory
includes test files, and those test files specify types that the tool is
interested in (e.g. struct types) then it will trigger a compiler error,
fail to generate, and leave some detritus in the target directory.

We should filter out test files from consideration to prevent this error
from occuring. Future development could include a command line option to
process test files, if anyone wants that (unlikely).
2019-04-02 14:32:02 +01:00
warnar boekkooi fc8e2d7bfe Add support for TypeSpec docs
Since doc's can be added on both the generic declaration (GenDecl) as well as on the type declaration (TypeSpec) we need to check both.
In order to check both declaration we copy the GenDecl docs to the TypeSpec docs if the TypeSpec has no documentation.
2019-03-28 17:45:34 +01:00
Viktor Oreshkin ee7a228c55 Merge branch 'master' into default_gopath 2019-03-27 01:16:24 +03:00
Kenneth Shaw f60ef38230 Fixes a concurrency issue with package path cache
The `chromedp-gen` tool, which makes use of the raw code, would
occassionally encounter a concurrent map write (on slow systems). This
adds a simple `sync.RWMutex` to the map causing problems.
2018-12-18 09:40:51 -07:00
Viktor Oreshkin ca8ad92f71 Use go/build to get default GOPATH 2018-09-12 02:57:09 +03:00
Aleksandr Zelenin e0ec68febc go modules support 2018-08-23 03:47:26 +03:00
Vasily Romanov 0033ea3508 Merge branch 'master' into win-path 2018-07-24 01:17:34 +03:00
Irioth 48f134c461 #162 using default GOPATH for win and trim last newline character 2018-07-16 19:07:20 +03:00
Irioth 93f3cb8741 #162 use default GOPATH
annoying bug
2018-07-16 17:15:30 +03:00
Michael fa2eed830e refactor: remove CRLF 2018-06-06 15:56:57 +02:00
Kaur Kuut ed82988ca1 Removed Windows path lower-case conversion. 2017-11-19 18:09:07 +02:00
Vasily Romanov 4d347d79de Merge pull request #132 from jen20/default-gopath
Detect GOPATH if not specified in $GOPATH
2017-10-22 20:32:15 +03:00