Skip to content

Commit

Permalink
#248 applied the ast go source code processing order fix and correct…
Browse files Browse the repository at this point in the history
…ed log msg (#249)

-  #248 applied the ast go source code processing order fix and corrected
typo on logging info
- version updated to v0.12.3 and readme update
  • Loading branch information
jeevatkm committed Feb 7, 2019
1 parent 8c41d00 commit def102f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<p align="center">Visit aah's official website https://aahframework.org to learn more</p>
</p>
<p align="center">
<p align="center"><a href="https://travis-ci.org/go-aah/aah"><img src="https://travis-ci.org/go-aah/aah.svg?branch=master" alt="Build Status"></a> <a href="https://codecov.io/gh/go-aah/aah/branch/master"><img src="https://codecov.io/gh/go-aah/aah/branch/master/graph/badge.svg" alt="Code Coverage"></a> <a href="https://goreportcard.com/report/aahframe.work"><img src="https://goreportcard.com/badge/aahframe.work" alt="Go Report Card"></a> <a href="https://github.com/go-aah/aah/releases/latest"><img src="https://img.shields.io/badge/version-0.12.2-blue.svg" alt="Release Version"></a> <a href="https://godoc.org/aahframe.work"><img src="https://godoc.org/aahframe.work?status.svg" alt="Godoc"></a> <a href="https://twitter.com/aahframework"><img src="https://img.shields.io/badge/twitter-@aahframework-55acee.svg" alt="Twitter @aahframework"></a></p>
<p align="center"><a href="https://travis-ci.org/go-aah/aah"><img src="https://travis-ci.org/go-aah/aah.svg?branch=master" alt="Build Status"></a> <a href="https://codecov.io/gh/go-aah/aah/branch/master"><img src="https://codecov.io/gh/go-aah/aah/branch/master/graph/badge.svg" alt="Code Coverage"></a> <a href="https://goreportcard.com/report/aahframe.work"><img src="https://goreportcard.com/badge/aahframe.work" alt="Go Report Card"></a> <a href="https://github.com/go-aah/aah/releases/latest"><img src="https://img.shields.io/badge/version-0.12.3-blue.svg" alt="Release Version"></a> <a href="https://godoc.org/aahframe.work"><img src="https://godoc.org/aahframe.work?status.svg" alt="Godoc"></a> <a href="https://twitter.com/aahframework"><img src="https://img.shields.io/badge/twitter-@aahframework-55acee.svg" alt="Twitter @aahframework"></a></p>
</p>

### News

* `v0.12.3` [released](https://docs.aahframework.org/release-notes.html) and tagged on Feb 06, 2019.
* `v0.12.2` [released](https://docs.aahframework.org/release-notes.html) and tagged on Dec 13, 2018.
* `v0.12.0` [released](https://docs.aahframework.org/release-notes.html) and tagged on Dec 02, 2018.
* `v0.11.4` [released](https://docs.aahframework.org/v0.11/release-notes.html) and tagged on Aug 27, 2018.
Expand All @@ -18,7 +19,7 @@
[![Stargazers over time](https://starcharts.herokuapp.com/go-aah/aah.svg)](https://starcharts.herokuapp.com/go-aah/aah)


### Why aah?
### Introduction

aah aims to provide necessary components to build modern Web, API and WebSocket applications. aah framework is secure, rapid and extensible. It takes full care of infrastructure, boilerplate code, repetitive activities, reusable components, etc.

Expand Down
12 changes: 8 additions & 4 deletions ainsp/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,24 @@ func (prg *Program) CreateImportPaths(types []*typeInfo, importPaths map[string]
func (prg *Program) process() {
for _, pkgInfo := range prg.Packages {
pkgInfo.Types = map[string]*typeInfo{}
fileImports := make(map[string]string)

// Each source file
// Processing package import path and type
for name, file := range pkgInfo.Pkg.Files {
pkgInfo.Files = append(pkgInfo.Files, filepath.Base(name))
fileImports := make(map[string]string)

for _, decl := range file.Decls {
// Processing imports
pkgInfo.processImports(decl, fileImports)

// Processing types
pkgInfo.processTypes(decl, fileImports)
}
}

// Processing methods
// Process methods only after `Type` and `Import Path` are resolved.
// Refer to GitHub #248 for more info.
for _, file := range pkgInfo.Pkg.Files {
for _, decl := range file.Decls {
processMethods(pkgInfo, prg.RegisteredActions, decl, fileImports)
}
}
Expand Down
3 changes: 1 addition & 2 deletions ainsp/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ func processMethods(pkg *packageInfo, routeMethods map[string]map[string]uint8,
if ty := pkg.Types[controllerName]; ty == nil {
pos := pkg.Fset.Position(decl.Pos())
filename := stripGoPath(pos.Filename)
fmt.Println("filename", filename, "pos.Filename", pos.Filename)
log.Errorf("AST: Method '%s' has incorrect struct recevier '%s' on file [%s] at line #%d",
log.Errorf("AST: Method '%s' has incorrect struct receiver '%s' on file [%s] at line #%d",
actionName, controllerName, filename, pos.Line)
} else {
ty.Methods = append(ty.Methods, method)
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
package aah

// Version no. of aah framework
const Version = "0.12.2"
const Version = "0.12.3"

0 comments on commit def102f

Please sign in to comment.