Skip to content

Commit def102f

Browse files
authored
#248 applied the ast go source code processing order fix and corrected 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
1 parent 8c41d00 commit def102f

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<p align="center">Visit aah's official website https://aahframework.org to learn more</p>
55
</p>
66
<p align="center">
7-
<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/[email protected]" alt="Twitter @aahframework"></a></p>
7+
<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/[email protected]" alt="Twitter @aahframework"></a></p>
88
</p>
99

1010
### News
1111

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

2021

21-
### Why aah?
22+
### Introduction
2223

2324
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.
2425

ainsp/program.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,24 @@ func (prg *Program) CreateImportPaths(types []*typeInfo, importPaths map[string]
8585
func (prg *Program) process() {
8686
for _, pkgInfo := range prg.Packages {
8787
pkgInfo.Types = map[string]*typeInfo{}
88+
fileImports := make(map[string]string)
8889

89-
// Each source file
90+
// Processing package import path and type
9091
for name, file := range pkgInfo.Pkg.Files {
9192
pkgInfo.Files = append(pkgInfo.Files, filepath.Base(name))
92-
fileImports := make(map[string]string)
93-
9493
for _, decl := range file.Decls {
9594
// Processing imports
9695
pkgInfo.processImports(decl, fileImports)
9796

9897
// Processing types
9998
pkgInfo.processTypes(decl, fileImports)
99+
}
100+
}
100101

101-
// Processing methods
102+
// Process methods only after `Type` and `Import Path` are resolved.
103+
// Refer to GitHub #248 for more info.
104+
for _, file := range pkgInfo.Pkg.Files {
105+
for _, decl := range file.Decls {
102106
processMethods(pkgInfo, prg.RegisteredActions, decl, fileImports)
103107
}
104108
}

ainsp/util.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ func processMethods(pkg *packageInfo, routeMethods map[string]map[string]uint8,
136136
if ty := pkg.Types[controllerName]; ty == nil {
137137
pos := pkg.Fset.Position(decl.Pos())
138138
filename := stripGoPath(pos.Filename)
139-
fmt.Println("filename", filename, "pos.Filename", pos.Filename)
140-
log.Errorf("AST: Method '%s' has incorrect struct recevier '%s' on file [%s] at line #%d",
139+
log.Errorf("AST: Method '%s' has incorrect struct receiver '%s' on file [%s] at line #%d",
141140
actionName, controllerName, filename, pos.Line)
142141
} else {
143142
ty.Methods = append(ty.Methods, method)

version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
package aah
66

77
// Version no. of aah framework
8-
const Version = "0.12.2"
8+
const Version = "0.12.3"

0 commit comments

Comments
 (0)