From d0567a63b49ef16462c99228a953b66d9400c9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=95=86=E8=AE=AF=E5=9C=A8=E7=BA=BF?= Date: Tue, 11 Feb 2014 21:42:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A5=E9=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 商讯在线 --- engine.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/engine.go b/engine.go index 73adc8df..6e2cbad5 100644 --- a/engine.go +++ b/engine.go @@ -486,8 +486,7 @@ func (engine *Engine) mapType(t reflect.Type) *Table { var indexType int var indexName string var preKey string - for j, ln := 0, len(tags); j < ln; j++ { - key := tags[j] + for j, key := range tags { k := strings.ToUpper(key) switch { case k == "<-": @@ -538,18 +537,7 @@ func (engine *Engine) mapType(t reflect.Type) *Table { if preKey != "DEFAULT" { col.Name = key[1 : len(key)-1] } - } else if strings.Contains(k, "(") && (strings.HasSuffix(k, ")") || strings.HasSuffix(k, ",")) { - //[SWH|+] - if strings.HasSuffix(k, ",") { - j++ - for j < ln { - k += tags[j] - if strings.HasSuffix(tags[j], ")") { - break - } - j++ - } - } + } else if strings.Contains(k, "(") && strings.HasSuffix(k, ")") { fs := strings.Split(k, "(") if _, ok := sqlTypes[fs[0]]; !ok { preKey = k From 1927a64cf31f64a9672f070be1c012b562640c89 Mon Sep 17 00:00:00 2001 From: Nash Tsai Date: Wed, 12 Feb 2014 11:29:27 +0800 Subject: [PATCH 2/2] Update CONTRIBUTING.md add links for fork a repo to --- CONTRIBUTING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7fde071..6f65c2ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,17 @@ ## Contributing to xorm -`xorm` has a backlog of pull requests, but contributions are still very +`xorm` has a backlog of [pull requests](https://help.github.com/articles/using-pull-requests), but contributions are still very much welcome. You can help with patch review, submitting bug reports, or adding new functionality. There is no formal style guide, but please conform to the style of existing code and general Go formatting conventions when submitting patches. +* [fork a repo](https://help.github.com/articles/fork-a-repo) +* [creating a pull request ](https://help.github.com/articles/creating-a-pull-request) + ### Patch review -Help review existing open pull requests by commenting on the code or +Help review existing open [pull requests](https://help.github.com/articles/using-pull-requests) by commenting on the code or proposed functionality. ### Bug reports