More...
|
| virtual bool | AutoLoad [get, set] |
| | True to automatically load the related store from a remote source when instantiated. Defaults to false. More...
|
| |
| virtual string | FilterProperty [get, set] |
| | Optionally overrides the default filter that is set up on the associated Store. If this is not set, a filter is automatically created which filters the association based on the configured foreignKey. See intro docs for more details. Defaults to undefined More...
|
| |
| virtual string | ForeignKey [get, set] |
| | The name of the foreign key on the associated model that links it to the owner model. Defaults to the lowercased name of the owner model plus "_id", e.g. an association with a where a model called Group hasMany Users would create 'group_id' as the foreign key. More...
|
| |
| virtual string | Name [get, set] |
| | The name of the function to create on the owner model to retrieve the child store. If not specified, the pluralized name of the child model is used. More...
|
| |
| virtual string | AssociationKey [get, set] |
| | The name of the property in the data to read the association from. Defaults to the name of the associated model. More...
|
| |
| virtual string | PrimaryKey [get, set] |
| | The name of the primary key on the associated model. In general this will be the Ext.data.Model.idProperty of the Model. Defaults to 'id' More...
|
| |
| virtual string | Model [get, set] |
| | The string name of the model that is being associated with. Required More...
|
| |
◆ CreateAssociation()
◆ AutoLoad
| virtual bool Ext.Net.MVC.HasManyAssociationAttribute.AutoLoad |
|
getset |
True to automatically load the related store from a remote source when instantiated. Defaults to false.
◆ FilterProperty
| virtual string Ext.Net.MVC.HasManyAssociationAttribute.FilterProperty |
|
getset |
Optionally overrides the default filter that is set up on the associated Store. If this is not set, a filter is automatically created which filters the association based on the configured foreignKey. See intro docs for more details. Defaults to undefined
◆ ForeignKey
| virtual string Ext.Net.MVC.HasManyAssociationAttribute.ForeignKey |
|
getset |
The name of the foreign key on the associated model that links it to the owner model. Defaults to the lowercased name of the owner model plus "_id", e.g. an association with a where a model called Group hasMany Users would create 'group_id' as the foreign key.
◆ Name
| virtual string Ext.Net.MVC.HasManyAssociationAttribute.Name |
|
getset |
The name of the function to create on the owner model to retrieve the child store. If not specified, the pluralized name of the child model is used.
The documentation for this class was generated from the following file:
- HasManyAssociationAttribute.cs


Great for emphasis, home pages, sliders, and general just-add-water-awesomeness.
##Basic Usage
Include the stylesheet on your document’s

<link rel="stylesheet" href="animate.min.css">

Add the class animated
to the element you want to animate.
You may also want to include the class infinite
for an infinite loop.
Finally you need to add one of the following classes:
bounce
flash
pulse
rubberBand
shake
swing
tada
wobble
jello
bounceIn
bounceInDown
bounceInLeft
bounceInRight
bounceInUp
bounceOut
bounceOutDown
bounceOutLeft
bounceOutRight
bounceOutUp
fadeIn
fadeInDown
fadeInDownBig
fadeInLeft
fadeInLeftBig
fadeInRight
fadeInRightBig
fadeInUp
fadeInUpBig
fadeOut
fadeOutDown
fadeOutDownBig
fadeOutLeft
fadeOutLeftBig
fadeOutRight
fadeOutRightBig
fadeOutUp
fadeOutUpBig
flipInX
flipInY
flipOutX
flipOutY
lightSpeedIn
lightSpeedOut
rotateIn
rotateInDownLeft
rotateInDownRight
rotateInUpLeft
rotateInUpRight
rotateOut
rotateOutDownLeft
rotateOutDownRight
rotateOutUpLeft
rotateOutUpRight
hinge
rollIn
rollOut
zoomIn
zoomInDown
zoomInLeft
zoomInRight
zoomInUp
zoomOut
zoomOutDown
zoomOutLeft
zoomOutRight
zoomOutUp
slideInDown
slideInLeft
slideInRight
slideInUp
slideOutDown
slideOutLeft
slideOutRight
slideOutUp
Full example:

Example

##Usage
To use animate.css in your website, simply drop the stylesheet into your document’s
, and add the class animated
to an element, along with any of the animation names. That’s it! You’ve got a CSS animated element. Super!

<link rel="stylesheet" href="animate.min.css">

You can do a whole bunch of other stuff with animate.css when you combine it with jQuery or add your own CSS rules. Dynamically add animations using jQuery with ease:
$('#yourElement').addClass('animated bounceOutLeft');
You can also detect when an animation ends:
$('#yourElement').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', doSomething);
View a video tutorial on how to use Animate.css with jQuery here.
Note: jQuery.one()
is used when you want to execute the event handler at most once. More information here.
You can change the duration of your animations, add a delay or change the number of times that it plays:
#yourElement {
-vendor-animation-duration: 3s;
-vendor-animation-delay: 2s;
-vendor-animation-iteration-count: infinite;
}
Note: be sure to replace “vendor” in the CSS with the applicable vendor prefixes (webkit, moz, etc)
Animate.css is powered by Grunt, and you can create custom builds pretty easily. First of all, you’ll need Grunt and all other dependencies:
$ cd path/to/animate.css/
$ sudo npm install
Next, run grunt watch
to watch for changes and compile your custom builds. For example, if you want only some of the the “attention seekers”, simply edit the animate-config.json
file to select only the animations you want to use.
"attention_seekers": {
"bounce": true,
"flash": false,
"pulse": false,
"shake": true,
"swing": true,
"tada": true,
"wobble": true,
"jello":true
}
Animate.css is licensed under the MIT license. (http://opensource.org/licenses/MIT)
Pull requests are the way to go here. I apologise in advance for the slow action on pull requests and issues. I only have two rules for submitting a pull request: match the naming convention (camelCase, categorised [fades, bounces, etc]) and let us see a demo of submitted animations in a pen. That last one is important.


25% Since last month
30.22% Since last month
Total 10 Votes
| Client | Depart | Destination | State |
|---|---|---|---|
| {{transaction.user.first_name +' '+transaction.user.last_name}} | {{transaction.address_start + '-'+ transaction.city_start}} | {{transaction.address_destination + '-'+ transaction.city_destination}} | {{transaction.state}} |
| Type | Make | Register Number |
|---|---|---|
| {{vehicule.make}} |
{{vehicule.reg_number}}
|


Making Services auto-discoverable by the Metrics Service
Mobile Services that expose a metrics endpoint will already be auto-discovered by the Metrics Service. No additional steps are needed for Prometheus to poll for metrics from Mobile Services.
However, if you would like the Metrics Services to also gather metrics from your own Service, you will need the following:
-
Service has to have one of
org.aerogear.metrics/plain_endpoint
ororg.aerogear.metrics/ssl_endpoint
annotations. -
Metrics endpoint should have no authentication.
-
Metrics endpoint should be accessible by Prometheus instance.
Presence of one of the org.aerogear.metrics/plain_endpoint
or org.aerogear.metrics/ssl_endpoint
annotations makes the service auto-discoverable.
Value of the annotation will inform metrics service about where to look for metrics data when scraping.
For example, if a service is exposing an HTTP metrics endpoint at
/metrics
, the annoation would be:
org.aerogear.metrics/plain_endpoint: "/metrics"
If a service is exposing an HTTPS metrics endpoint at /rest/metrics
,
the annoation would be:
org.aerogear.metrics/ssl_endpoint: "/rest/metrics"
This endpoint mustn’t have any authentication currently. This is subject to change in the future.
Also, the endpoint should be accessible by the Prometheus instance. There should be a route for the endpoint that Prometheus can access. As Prometheus is using Kubernetes DNS name, the service needs to be in the same project as Prometheus. An advanced scenario with separate projects is possible, where the project networks would be linked.
More information is available on Prometheus Kubernetes SD documentation.
Here is an example piece of code taken from
FH-Sync Server Ansible Playbook Bundle,
that creates an fh-sync-server
service which
is auto-discoverable.
objects:
- apiVersion: v1
kind: Service
metadata:
name: fh-sync-server
annotations:
org.aerogear.metrics/plain_endpoint: "/metrics"
labels:
...
spec:
...
Another possibility is adding the label after the service is created.
An example of doing that with oc
CLI:
oc annotate service my-awesome-service "org.aerogear.metrics/plain_endpoint"="/metrics"
# OR
oc annotate service my-awesome-service "org.aerogear.metrics/ssl_endpoint"="/metrics"
Prometheus constantly monitors Kubernetes and will be notified about this change. It will start collecting the metrics immediately.
How auto-discovery works
As per Prometheus Kubernetes SD documentation, Prometheus stays synchronized with the cluster state.
In this case, it checks the annotations of services and compares them with the annotations that are defined in the Prometheus configuration,
i.e. org.aerogear.metrics/plain_endpoint
and org.aerogear.metrics/ssl_endpoint
. Once there is a service found with one of those annotations,
the service is picked up as a scrape target and the value of the matched annotation is used as the scrape endpoint path.
All of this is done in AeroGear metrics APB.
Disable metrics scraping
If you would like to disable metrics scraping for a service, just remove the annotation. Prometheus will stop collecting the metrics immediately.
oc annotate service my-awesome-service "org.aerogear.metrics/plain_endpoint"-
# OR
oc annotate service my-awesome-service "org.aerogear.metrics/ssl_endpoint"-
Please note that Prometheus queries for the metrics from the service might be returning the last value of a metric for a while. This means, you might see some value in your graphs for a while, even though the annotation was removed and scraping was stopped.


and yes, I did intend this to be formatted horribly. I can fix this if I wanted to, but I find the tacky 90s asthetic to be to my liking.


This is a beautiful paragraph about my game. My game features an alien space man character, and some coins. When you get twenty five coins, you win! Then the game will restart. It is very exciting. There is a wall of stone blocks at the edge so the alien space man character does not go off the edge into the abyss. At some point, I will likely add more features to this exciting game!


--- layout: default permalink: portfolio/websites/ html-title: Website design | HCd title: Website Design ---


MUPPET TREASURE ISLAND A film review by Michael John Legeros Copyright 1996 Michael John Legeros
(BV) Directed by Brian Henson Screenplay by Jerry Juhl, Kirk R. Thatcher, and James V. Hart, from the novel by Robert Louis Stevenson Cast Tim Curry, Kevin Bishop, Billy Connolly, Jennifer Saunders, Muppets MPAA Rating "G" Running Time 99 minutes Reviewed at General Cinemas at Pleasant Valley, Raleigh, NC (16FEB96)
==
Robert Louis Stevenson gets the musical Muppet treatment in this swashbuckling story of a boy, a rat, and a Great Gonzo who find adventure on the high-seas, under the judicious green thumb of a gracious Captain (Kermit the Frog), and the watchful eye of a particular pirate (Tim Curry, as Long John Silver). There's a surprisingly solid story to go along with the expected in-jokes, asides, and anachronisms; credit one of the writers, James V. Hart, who also co-wrote HOOK. But just as Renny Harlin and Geena Davis failed to patch the leaks in CUTTHROAT ISLAND, so have Brian Henson and Frank Oz sunk themselves with MUPPET TREASURE ISLAND. They've made a fine kid's movie that's *way* too slow for anyone over the age of eight. Even the songs are dull. Except, that is, for "Cabin Fever," an amusing number in mid-film that most adult viewers will be able to relate to. Arrgghh.
Grade: C-
--
Mike Legeros - Raleigh, NC
<EMAIL_ADDRESS>(h) -<EMAIL_ADDRESS>(w)
MOVIE HELL is on the Web!
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


E -CAFE
All Categories
Recent Orders
Most Orders
High Rated
Near You
search
orders
lked
HOME
ABOUT
MENU
RESTAURANTS
ADD RESTAURANT
SIGN UP
LOGIN
select Town
Mombasa
Kisumu
Machakos
Kajiado
Narok
Namanga
Kitengela
Kiserian
...
FILTER BY:
Restaurant
Price Range
Food Type
High Rated
Most Liked
SORT BY:
Pre Order Available
Deals
Online Payment Available
Delivery
Pick Up
Cash On Delivery
Vegeterian
Non Vegeterian
APPLY
CANCEL
remove filters
Ksh 01 - 100
Ksh 101 - 200
Ksh 201 - 500
Ksh 501 - 700
ksh 701 - 1000
Ksh 1001 - 1500
Ksh 1501 - 2000
Ksh 2000 - more
APPLY
CANCEL
remove filters
RESTAURANT NAME
RESTAURANT CATEGORY
COUNTY
TOWN
restaurant_data as $restaurant): ?>
= $restaurant['restaurant_name']?>
= $restaurant['restaurant_category']?>
= $restaurant['county']?>
= $restaurant['town']?>


This app is not configured for the github oauth login workflow. Please enter your github username/password. The credentials are stored in your browser. Generally you should
consider not to enter any of your secrets in broser windows other than the original site. If you are the administrator of this site please consider to enable oauth access - you
can find useful information here on the help pages.


Go version 1, Go 1 for short, defines a language and a set of core libraries that provide a stable foundation for creating reliable products, projects, and publications.
The driving motivation for Go 1 is stability for its users. People should be able to write Go programs and expect that they will continue to compile and run without change, on a time scale of years, including in production environments such as Google App Engine. Similarly, people should be able to write books about Go, be able to say which version of Go the book is describing, and have that version number still be meaningful much later.
Code that compiles in Go 1 should, with few exceptions, continue to compile and run throughout the lifetime of that version, even as we issue updates and bug fixes such as Go version 1.1, 1.2, and so on. Other than critical fixes, changes made to the language and library for subsequent releases of Go 1 may add functionality but will not break existing Go 1 programs. The Go 1 compatibility document explains the compatibility guidelines in more detail.
Go 1 is a representation of Go as it used today, not a wholesale rethinking of
the language. We avoided designing new features and instead focused on cleaning
up problems and inconsistencies and improving portability. There are a number
changes to the Go language and packages that we had considered for some time and
prototyped but not released primarily because they are significant and
backwards-incompatible. Go 1 was an opportunity to get them out, which is
helpful for the long term, but also means that Go 1 introduces incompatibilities
for old programs. Fortunately, the go
fix
tool can
automate much of the work needed to bring programs up to the Go 1 standard.
This document outlines the major changes in Go 1 that will affect programmers updating existing code; its reference point is the prior release, r60 (tagged as r60.3). It also explains how to update code from r60 to run under Go 1.
The append
predeclared variadic function makes it easy to grow a slice
by adding elements to the end.
A common use is to add bytes to the end of a byte slice when generating output.
However, append
did not provide a way to append a string to a []byte
,
which is another common case.
greeting := []byte{} greeting = append(greeting, []byte("hello ")...)
By analogy with the similar property of copy
, Go 1
permits a string to be appended (byte-wise) directly to a byte
slice, reducing the friction between strings and byte slices.
The conversion is no longer necessary:
greeting = append(greeting, "world"...)
Updating: This is a new feature, so existing code needs no changes.
The close
predeclared function provides a mechanism
for a sender to signal that no more values will be sent.
It is important to the implementation of for
range
loops over channels and is helpful in other situations.
Partly by design and partly because of race conditions that can occur otherwise,
it is intended for use only by the goroutine sending on the channel,
not by the goroutine receiving data.
However, before Go 1 there was no compile-time checking that close
was being used correctly.
To close this gap, at least in part, Go 1 disallows close
on receive-only channels.
Attempting to close such a channel is a compile-time error.
var c chan int var csend chan<- int = c var crecv <-chan int = c close(c) // legal close(csend) // legal close(crecv) // illegal
Updating: Existing code that attempts to close a receive-only channel was erroneous even before Go 1 and should be fixed. The compiler will now reject such code.
In Go 1, a composite literal of array, slice, or map type can elide the type specification for the elements' initializers if they are of pointer type. All four of the initializations in this example are legal; the last one was illegal before Go 1.
type Date struct { month string day int } // Struct values, fully qualified; always legal. holiday1 := []Date{ Date{"Feb", 14}, Date{"Nov", 11}, Date{"Dec", 25}, } // Struct values, type name elided; always legal. holiday2 := []Date{ {"Feb", 14}, {"Nov", 11}, {"Dec", 25}, } // Pointers, fully qualified, always legal. holiday3 := []*Date{ &Date{"Feb", 14}, &Date{"Nov", 11}, &Date{"Dec", 25}, } // Pointers, type name elided; legal in Go 1. holiday4 := []*Date{ {"Feb", 14}, {"Nov", 11}, {"Dec", 25}, }
Updating:
This change has no effect on existing code, but the command
gofmt
-s
applied to existing source
will, among other things, elide explicit element types wherever permitted.
The old language defined that go
statements executed during initialization created goroutines but that they did not begin to run until initialization of the entire program was complete.
This introduced clumsiness in many places and, in effect, limited the utility
of the init
construct:
if it was possible for another package to use the library during initialization, the library
was forced to avoid goroutines.
This design was done for reasons of simplicity and safety but,
as our confidence in the language grew, it seemed unnecessary.
Running goroutines during initialization is no more complex or unsafe than running them during normal execution.
In Go 1, code that uses goroutines can be called from
init
routines and global initialization expressions
without introducing a deadlock.
var PackageGlobal int func init() { c := make(chan int) go initializationFunction(c) PackageGlobal = <-c }
Updating:
This is a new feature, so existing code needs no changes,
although it's possible that code that depends on goroutines not starting before main
will break.
There was no such code in the standard repository.
The language spec allows the int
type to be 32 or 64 bits wide, but current implementations set int
to 32 bits even on 64-bit platforms.
It would be preferable to have int
be 64 bits on 64-bit platforms.
(There are important consequences for indexing large slices.)
However, this change would waste space when processing Unicode characters with
the old language because the int
type was also used to hold Unicode code points: each code point would waste an extra 32 bits of storage if int
grew from 32 bits to 64.
To make changing to 64-bit int
feasible,
Go 1 introduces a new basic type, rune
, to represent
individual Unicode code points.
It is an alias for int32
, analogous to byte
as an alias for uint8
.
Character literals such as 'a'
, '語'
, and '\u0345'
now have default type rune
,
analogous to 1.0
having default type float64
.
A variable initialized to a character constant will therefore
have type rune
unless otherwise specified.
Libraries have been updated to use rune
rather than int
when appropriate. For instance, the functions unicode.ToLower
and
relatives now take and return a rune
.
delta := 'δ' // delta has type rune.
var DELTA rune
DELTA = unicode.ToUpper(delta)
epsilon := unicode.ToLower(DELTA + 1)
if epsilon != 'δ'+1 {
log.Fatal("inconsistent casing for Greek")
}
Updating:
Most source code will be unaffected by this because the type inference from
:=
initializers introduces the new type silently, and it propagates
from there.
Some code may get type errors that a trivial conversion will resolve.
Go 1 introduces a new built-in type, error
, which has the following definition:
type error interface { Error() string }
Since the consequences of this type are all in the package library, it is discussed below.
In the old language, to delete the entry with key k
from map m
, one wrote the statement,
m[k] = value, false
This syntax was a peculiar special case, the only two-to-one assignment.
It required passing a value (usually ignored) that is evaluated but discarded,
plus a boolean that was nearly always the constant false
.
It did the job but was odd and a point of contention.
In Go 1, that syntax has gone; instead there is a new built-in
function, delete
. The call
delete(m, k)
will delete the map entry retrieved by the expression m[k]
.
There is no return value. Deleting a non-existent entry is a no-op.
Updating:
Running go
fix
will convert expressions of the form m[k] = value,
false
into delete(m, k)
when it is clear that
the ignored value can be safely discarded from the program and
false
refers to the predefined boolean constant.
The fix tool
will flag other uses of the syntax for inspection by the programmer.
The old language specification did not define the order of iteration for maps, and in practice it differed across hardware platforms. This caused tests that iterated over maps to be fragile and non-portable, with the unpleasant property that a test might always pass on one machine but break on another.
In Go 1, the order in which elements are visited when iterating
over a map using a for
range
statement
is defined to be unpredictable, even if the same loop is run multiple
times with the same map.
Code should not assume that the elements are visited in any particular order.
This change means that code that depends on iteration order is very likely to break early and be fixed long before it becomes a problem. Just as important, it allows the map implementation to ensure better map balancing even when programs are using range loops to select an element from a map.
m := map[string]int{"Sunday": 0, "Monday": 1}
for name, value := range m {
// This loop should not assume Sunday will be visited first.
f(name, value)
}
Updating: This is one change where tools cannot help. Most existing code will be unaffected, but some programs may break or misbehave; we recommend manual checking of all range statements over maps to verify they do not depend on iteration order. There were a few such examples in the standard repository; they have been fixed. Note that it was already incorrect to depend on the iteration order, which was unspecified. This change codifies the unpredictability.
The language specification has long guaranteed that in assignments the right-hand-side expressions are all evaluated before any left-hand-side expressions are assigned. To guarantee predictable behavior, Go 1 refines the specification further.
If the left-hand side of the assignment statement contains expressions that require evaluation, such as function calls or array indexing operations, these will all be done using the usual left-to-right rule before any variables are assigned their value. Once everything is evaluated, the actual assignments proceed in left-to-right order.
These examples illustrate the behavior.
sa := []int{1, 2, 3} i := 0 i, sa[i] = 1, 2 // sets i = 1, sa[0] = 2 sb := []int{1, 2, 3} j := 0 sb[j], j = 2, 1 // sets sb[0] = 2, j = 1 sc := []int{1, 2, 3} sc[0], sc[0] = 1, 2 // sets sc[0] = 1, then sc[0] = 2 (so sc[0] = 2 at end)
Updating: This is one change where tools cannot help, but breakage is unlikely. No code in the standard repository was broken by this change, and code that depended on the previous unspecified behavior was already incorrect.
A common mistake is to use return
(without arguments) after an assignment to a variable that has the same name as a result variable but is not the same variable.
This situation is called shadowing: the result variable has been shadowed by another variable with the same name declared in an inner scope.
In functions with named return values, the Go 1 compilers disallow return statements without arguments if any of the named return values is shadowed at the point of the return statement. (It isn't part of the specification, because this is one area we are still exploring; the situation is analogous to the compilers rejecting functions that do not end with an explicit return statement.)
This function implicitly returns a shadowed return value and will be rejected by the compiler:
func Bug() (i, j, k int) { for i = 0; i < 5; i++ { for j := 0; j < 5; j++ { // Redeclares j. k += i*j if k > 100 { return // Rejected: j is shadowed here. } } } return // OK: j is not shadowed here. }
Updating: Code that shadows return values in this way will be rejected by the compiler and will need to be fixed by hand. The few cases that arose in the standard repository were mostly bugs.
The old language did not allow a package to make a copy of a struct value containing unexported fields belonging to a different package.
There was, however, a required exception for a method receiver;
also, the implementations of copy
and append
have never honored the restriction.
Go 1 will allow packages to copy struct values containing unexported fields from other packages.
Besides resolving the inconsistency,
this change admits a new kind of API: a package can return an opaque value without resorting to a pointer or interface.
The new implementations of time.Time
and
reflect.Value
are examples of types taking advantage of this new property.
As an example, if package p
includes the definitions,
type Struct struct { Public int secret int } func NewStruct(a int) Struct { // Note: not a pointer. return Struct{a, f(a)} } func (s Struct) String() string { return fmt.Sprintf("{%d (secret %d)}", s.Public, s.secret) }
a package that imports p
can assign and copy values of type
p.Struct
at will.
Behind the scenes the unexported fields will be assigned and copied just
as if they were exported,
but the client code will never be aware of them. The code
import "p" myStruct := p.NewStruct(23) copyOfMyStruct := myStruct fmt.Println(myStruct, copyOfMyStruct)
will show that the secret field of the struct has been copied to the new value.
Updating: This is a new feature, so existing code needs no changes.
Before Go 1, the language did not define equality on struct and array values. This meant, among other things, that structs and arrays could not be used as map keys. On the other hand, Go did define equality on function and map values. Function equality was problematic in the presence of closures (when are two closures equal?) while map equality compared pointers, not the maps' content, which was usually not what the user would want.
Go 1 addressed these issues.
First, structs and arrays can be compared for equality and inequality
(==
and !=
),
and therefore be used as map keys,
provided they are composed from elements for which equality is also defined,
using element-wise comparison.
type Day struct { long string short string } Christmas := Day{"Christmas", "XMas"} Thanksgiving := Day{"Thanksgiving", "Turkey"} holiday := map[Day]bool{ Christmas: true, Thanksgiving: true, } fmt.Printf("Christmas is a holiday: %t\n", holiday[Christmas])
Second, Go 1 removes the definition of equality for function values,
except for comparison with nil
.
Finally, map equality is gone too, also except for comparison with nil
.
Note that equality is still undefined for slices, for which the
calculation is in general infeasible. Also note that the ordered
comparison operators (<
<=
>
>=
) are still undefined for
structs and arrays.
Updating: Struct and array equality is a new feature, so existing code needs no changes. Existing code that depends on function or map equality will be rejected by the compiler and will need to be fixed by hand. Few programs will be affected, but the fix may require some redesign.
Go 1 addresses many deficiencies in the old standard library and cleans up a number of packages, making them more internally consistent and portable.
This section describes how the packages have been rearranged in Go 1. Some have moved, some have been renamed, some have been deleted. New packages are described in later sections.
Go 1 has a rearranged package hierarchy that groups related items
into subdirectories. For instance, utf8
and
utf16
now occupy subdirectories of unicode
.
Also, some packages have moved into
subrepositories of
code.google.com/p/go
while others have been deleted outright.
| Old path | New path |
|---|---|
| asn1 | encoding/asn1 |
| csv | encoding/csv |
| gob | encoding/gob |
| json | encoding/json |
| xml | encoding/xml |
| exp/template/html | html/template |
| big | math/big |
| cmath | math/cmplx |
| rand | math/rand |
| http | net/http |
| http/cgi | net/http/cgi |
| http/fcgi | net/http/fcgi |
| http/httptest | net/http/httptest |
| http/pprof | net/http/pprof |
| net/mail | |
| rpc | net/rpc |
| rpc/jsonrpc | net/rpc/jsonrpc |
| smtp | net/smtp |
| url | net/url |
| exec | os/exec |
| scanner | text/scanner |
| tabwriter | text/tabwriter |
| template | text/template |
| template/parse | text/template/parse |
| utf8 | unicode/utf8 |
| utf16 | unicode/utf16 |
Note that the package names for the old cmath
and
exp/template/html
packages have changed to cmplx
and template
.
Updating:
Running go
fix
will update all imports and package renames for packages that
remain inside the standard repository. Programs that import packages
that are no longer in the standard repository will need to be edited
by hand.
Because they are not standardized, the packages under the exp
directory will not be available in the
standard Go 1 release distributions, although they will be available in source code form
in the repository for
developers who wish to use them.
Several packages have moved under exp
at the time of Go 1's release:
ebnf
html
†go/types
(†The EscapeString
and UnescapeString
types remain
in package html
.)
All these packages are available under the same names, with the prefix exp/
: exp/ebnf
etc.
Also, the utf8.String
type has been moved to its own package, exp/utf8string
.
Finally, the gotype
command now resides in exp/gotype
, while
ebnflint
is now in exp/ebnflint
.
If they are installed, they now reside in $GOROOT/bin/tool
.
Updating:
Code that uses packages in exp
will need to be updated by hand,
or else compiled from an installation that has exp
available.
The go
fix
tool or the compiler will complain about such uses.
Because they are deprecated, the packages under the old
directory will not be available in the
standard Go 1 release distributions, although they will be available in source code form for
developers who wish to use them.
The packages in their new locations are:
old/netchan
old/regexp
old/template
Updating:
Code that uses packages now in old
will need to be updated by hand,
or else compiled from an installation that has old
available.
The go
fix
tool will warn about such uses.
Go 1 deletes several packages outright:
container/vector
exp/datafmt
go/typechecker
try
and also the command gotry
.
Updating:
Code that uses container/vector
should be updated to use
slices directly. See
the Go
Language Community Wiki for some suggestions.
Code that uses the other packages (there should be almost zero) will need to be rethought.
Go 1 has moved a number of packages into other repositories, usually sub-repositories of the main Go repository. This table lists the old and new import paths:
| Old | New |
|---|---|
| crypto/bcrypt | code.google.com/p/go.crypto/bcrypt |
| crypto/blowfish | code.google.com/p/go.crypto/blowfish |
| crypto/cast5 | code.google.com/p/go.crypto/cast5 |
| crypto/md4 | code.google.com/p/go.crypto/md4 |
| crypto/ocsp | code.google.com/p/go.crypto/ocsp |
| crypto/openpgp | code.google.com/p/go.crypto/openpgp |
| crypto/openpgp/armor | code.google.com/p/go.crypto/openpgp/armor |
| crypto/openpgp/elgamal | code.google.com/p/go.crypto/openpgp/elgamal |
| crypto/openpgp/errors | code.google.com/p/go.crypto/openpgp/errors |
| crypto/openpgp/packet | code.google.com/p/go.crypto/openpgp/packet |
| crypto/openpgp/s2k | code.google.com/p/go.crypto/openpgp/s2k |
| crypto/ripemd160 | code.google.com/p/go.crypto/ripemd160 |
| crypto/twofish | code.google.com/p/go.crypto/twofish |
| crypto/xtea | code.google.com/p/go.crypto/xtea |
| exp/ssh | code.google.com/p/go.crypto/ssh |
| image/bmp | code.google.com/p/go.image/bmp |
| image/tiff | code.google.com/p/go.image/tiff |
| net/dict | code.google.com/p/go.net/dict |
| net/websocket | code.google.com/p/go.net/websocket |
| exp/spdy | code.google.com/p/go.net/spdy |
| encoding/git85 | code.google.com/p/go.codereview/git85 |
| patch | code.google.com/p/go.codereview/patch |
| exp/wingui | code.google.com/p/gowingui |
Updating:
Running go
fix
will update imports of these packages to use the new import paths.
Installations that depend on these packages will need to install them using
a go get
command.
This section describes significant changes to the core libraries, the ones that affect the most programs.
The placement of os.Error
in package os
is mostly historical: errors first came up when implementing package os
, and they seemed system-related at the time.
Since then it has become clear that errors are more fundamental than the operating system. For example, it would be nice to use Errors
in packages that os
depends on, like syscall
.
Also, having Error
in os
introduces many dependencies on os
that would otherwise not exist.
Go 1 solves these problems by introducing a built-in error
interface type and a separate errors
package (analogous to bytes
and strings
) that contains utility functions.
It replaces os.NewError
with
errors.New
,
giving errors a more central place in the environment.
So the widely-used String
method does not cause accidental satisfaction
of the error
interface, the error
interface uses instead
the name Error
for that method:
type error interface { Error() string }
The fmt
library automatically invokes Error
, as it already
does for String
, for easy printing of error values.
type SyntaxError struct { File string Line int Message string } func (se *SyntaxError) Error() string { return fmt.Sprintf("%s:%d: %s", se.File, se.Line, se.Message) }
All standard packages have been updated to use the new interface; the old os.Error
is gone.
A new package, errors
, contains the function
func New(text string) error
to turn a string into an error. It replaces the old os.NewError
.
var ErrSyntax = errors.New("syntax error")
Updating:
Running go
fix
will update almost all code affected by the change.
Code that defines error types with a String
method will need to be updated
by hand to rename the methods to Error
.
The old syscall
package, which predated os.Error
(and just about everything else),
returned errors as int
values.
In turn, the os
package forwarded many of these errors, such
as EINVAL
, but using a different set of errors on each platform.
This behavior was unpleasant and unportable.
In Go 1, the
syscall
package instead returns an error
for system call errors.
On Unix, the implementation is done by a
syscall.Errno
type
that satisfies error
and replaces the old os.Errno
.
The changes affecting os.EINVAL
and relatives are
described elsewhere.
Updating:
Running go
fix
will update almost all code affected by the change.
Regardless, most code should use the os
package
rather than syscall
and so will be unaffected.
Time is always a challenge to support well in a programming language.

One of the most sweeping changes in the Go 1 library is therefore a
complete redesign of the
time
package.
Instead of an integer number of nanoseconds as an int64
,
and a separate *time.Time
type to deal with human
units such as hours and years,
there are now two fundamental types:
time.Time
(a value, so the *
is gone), which represents a moment in time;
and time.Duration
,
which represents an interval.
Both have nanosecond resolution.
A Time
can represent any time into the ancient
past and remote future, while a Duration
can
span plus or minus only about 290 years.
There are methods on these types, plus a number of helpful
predefined constant durations such as time.Second
.
Among the new methods are things like
Time.Add
,
which adds a Duration
to a Time
, and
Time.Sub
,
which subtracts two Times
to yield a Duration
.
The most important semantic change is that the Unix epoch (Jan 1, 1970) is now
relevant only for those functions and methods that mention Unix:
time.Unix
and the Unix
and UnixNano
methods
of the Time
type.
In particular,
time.Now
returns a time.Time
value rather than, in the old
API, an integer nanosecond count since the Unix epoch.
// sleepUntil sleeps until the specified time. It returns immediately if it's too late. func sleepUntil(wakeup time.Time) { now := time.Now() // A Time. if !wakeup.After(now) { return } delta := wakeup.Sub(now) // A Duration. fmt.Printf("Sleeping for %.3fs\n", delta.Seconds()) time.Sleep(delta) }
The new types, methods, and constants have been propagated through
all the standard packages that use time, such as os
and
its representation of file time stamps.
Updating:
The go
fix
tool will update many uses of the old time
package to use the new
types and methods, although it does not replace values such as 1e9
representing nanoseconds per second.
Also, because of type changes in some of the values that arise,
some of the expressions rewritten by the fix tool may require
further hand editing; in such cases the rewrite will include
the correct function or method for the old functionality, but
may have the wrong type or require further analysis.
This section describes smaller changes, such as those to less commonly
used packages or that affect
few programs beyond the need to run go
fix
.
This category includes packages that are new in Go 1.
Collectively they improve portability, regularize behavior, and
make the interfaces more modern and Go-like.
In Go 1, *zip.Writer
no
longer has a Write
method. Its presence was a mistake.
Updating: What little code is affected will be caught by the compiler and must be updated by hand.
In Go 1, bufio.NewReaderSize
and
bufio.NewWriterSize
functions no longer return an error for invalid sizes.
If the argument size is too small or invalid, it is adjusted.
Updating:
Running go
fix
will update calls that assign the error to _.
Calls that aren't fixed will be caught by the compiler and must be updated by hand.
In Go 1, the NewWriterXxx
functions in
compress/flate
,
compress/gzip
and
compress/zlib
all return (*Writer, error)
if they take a compression level,
and *Writer
otherwise. Package gzip
's
Compressor
and Decompressor
types have been renamed
to Writer
and Reader
. Package flate
's
WrongValueError
type has been removed.
Updating
Running go
fix
will update old names and calls that assign the error to _.
Calls that aren't fixed will be caught by the compiler and must be updated by hand.
In Go 1, the Reset
method has been removed. Go does not guarantee
that memory is not copied and therefore this method was misleading.
The cipher-specific types *aes.Cipher
, *des.Cipher
,
and *des.TripleDESCipher
have been removed in favor of
cipher.Block
.
Updating: Remove the calls to Reset. Replace uses of the specific cipher types with cipher.Block.
In Go 1, elliptic.Curve
has been made an interface to permit alternative implementations. The curve
parameters have been moved to the
elliptic.CurveParams
structure.
Updating:
Existing users of *elliptic.Curve
will need to change to
simply elliptic.Curve
. Calls to Marshal
,
Unmarshal
and GenerateKey
are now functions
in crypto/elliptic
that take an elliptic.Curve
as their first argument.
In Go 1, the hash-specific functions, such as hmac.NewMD5
, have
been removed from crypto/hmac
. Instead, hmac.New
takes
a function that returns a hash.Hash
, such as md5.New
.
Updating:
Running go
fix
will perform the needed changes.
In Go 1, the
CreateCertificate
and
CreateCRL
functions in crypto/x509
have been altered to take an
interface{}
where they previously took a *rsa.PublicKey
or *rsa.PrivateKey
. This will allow other public key algorithms
to be implemented in the future.
Updating: No changes will be needed.
In Go 1, the binary.TotalSize
function has been replaced by
Size
,
which takes an interface{}
argument rather than
a reflect.Value
.
Updating: What little code is affected will be caught by the compiler and must be updated by hand.
In Go 1, the xml
package
has been brought closer in design to the other marshaling packages such
as encoding/gob
.
The old Parser
type is renamed
Decoder
and has a new
Decode
method. An
Encoder
type was also introduced.
The functions Marshal
and Unmarshal
work with []byte
values now. To work with streams,
use the new Encoder
and Decoder
types.
When marshaling or unmarshaling values, the format of supported flags in
field tags has changed to be closer to the
json
package
(`xml:"name,flag"`
). The matching done between field tags, field
names, and the XML attribute and element names is now case-sensitive.
The XMLName
field tag, if present, must also match the name
of the XML element being marshaled.
Updating:
Running go
fix
will update most uses of the package except for some calls to
Unmarshal
. Special care must be taken with field tags,
since the fix tool will not update them and if not fixed by hand they will
misbehave silently in some cases. For example, the old
"attr"
is now written ",attr"
while plain
"attr"
remains valid but with a different meaning.
In Go 1, the RemoveAll
function has been removed.
The Iter
function and Iter method on *Map
have
been replaced by
Do
and
(*Map).Do
.
Updating:
Most code using expvar
will not need changing. The rare code that used
Iter
can be updated to pass a closure to Do
to achieve the same effect.
In Go 1, the interface flag.Value
has changed slightly.
The Set
method now returns an error
instead of
a bool
to indicate success or failure.
There is also a new kind of flag, Duration
, to support argument
values specifying time intervals.
Values for such flags must be given units, just as time.Duration
formats them: 10s
, 1h30m
, etc.
var timeout = flag.Duration("timeout", 30*time.Second, "how long to wait for completion")
Updating:
Programs that implement their own flags will need minor manual fixes to update their
Set
methods.
The Duration
flag is new and affects no existing code.
Several packages under go
have slightly revised APIs.
A concrete Mode
type was introduced for configuration mode flags
in the packages
go/scanner
,
go/parser
,
go/printer
, and
go/doc
.
The modes AllowIllegalChars
and InsertSemis
have been removed
from the go/scanner
package. They were mostly
useful for scanning text other then Go source files. Instead, the
text/scanner
package should be used
for that purpose.
The ErrorHandler
provided
to the scanner's Init
method is
now simply a function rather than an interface. The ErrorVector
type has
been removed in favor of the (existing) ErrorList
type, and the ErrorVector
methods have been migrated. Instead of embedding
an ErrorVector
in a client of the scanner, now a client should maintain
an ErrorList
.
The set of parse functions provided by the go/parser
package has been reduced to the primary parse function
ParseFile
, and a couple of
convenience functions ParseDir
and ParseExpr
.
The go/printer
package supports an additional
configuration mode SourcePos
;
if set, the printer will emit //line
comments such that the generated
output contains the original source code position information. The new type
CommentedNode
can be
used to provide comments associated with an arbitrary
ast.Node
(until now only
ast.File
carried comment information).
The type names of the go/doc
package have been
streamlined by removing the Doc
suffix: PackageDoc
is now Package
, ValueDoc
is Value
, etc.
Also, all types now consistently have a Name
field (or Names
,
in the case of type Value
) and Type.Factories
has become
Type.Funcs
.
Instead of calling doc.NewPackageDoc(pkg, importpath)
,
documentation for a package is created with:
doc.New(pkg, importpath, mode)
where the new mode
parameter specifies the operation mode:
if set to AllDecls
, all declarations
(not just exported ones) are considered.
The function NewFileDoc
was removed, and the function
CommentText
has become the method
Text
of
ast.CommentGroup
.
In package go/token
, the
token.FileSet
method Files
(which originally returned a channel of *token.File
s) has been replaced
with the iterator Iterate
that
accepts a function argument instead.
In package go/build
, the API
has been nearly completely replaced.
The package still computes Go package information
but it does not run the build: the Cmd
and Script
types are gone.
(To build code, use the new
go
command instead.)
The DirInfo
type is now named
Package
.
FindTree
and ScanDir
are replaced by
Import
and
ImportDir
.
Updating:
Code that uses packages in go
will have to be updated by hand; the
compiler will reject incorrect uses. Templates used in conjunction with any of the
go/doc
types may need manual fixes; the renamed fields will lead
to run-time errors.
In Go 1, the definition of hash.Hash
includes
a new method, BlockSize
. This new method is used primarily in the
cryptographic libraries.
The Sum
method of the
hash.Hash
interface now takes a
[]byte
argument, to which the hash value will be appended.
The previous behavior can be recreated by adding a nil
argument to the call.
Updating:
Existing implementations of hash.Hash
will need to add a
BlockSize
method. Hashes that process the input one byte at
a time can implement BlockSize
to return 1.
Running go
fix
will update calls to the Sum
methods of the various
implementations of hash.Hash
.
Updating: Since the package's functionality is new, no updating is necessary.
In Go 1 the http
package is refactored,
putting some of the utilities into a
httputil
subdirectory.
These pieces are only rarely needed by HTTP clients.
The affected items are:
The Request.RawURL
field has been removed; it was a
historical artifact.
The Handle
and HandleFunc
functions, and the similarly-named methods of ServeMux
,
now panic if an attempt is made to register the same pattern twice.
Updating:
Running go
fix
will update the few programs that are affected except for
uses of RawURL
, which must be fixed by hand.
The image
package has had a number of
minor changes, rearrangements and renamings.
Most of the color handling code has been moved into its own package,
image/color
.
For the elements that moved, a symmetry arises; for instance,
each pixel of an
image.RGBA
is a
color.RGBA
.
The old image/ycbcr
package has been folded, with some
renamings, into the
image
and
image/color
packages.
The old image.ColorImage
type is still in the image
package but has been renamed
image.Uniform
,
while image.Tiled
has been removed.
This table lists the renamings.
| Old | New |
|---|---|
| image.Color | color.Color |
| image.ColorModel | color.Model |
| image.ColorModelFunc | color.ModelFunc |
| image.PalettedColorModel | color.Palette |
| image.RGBAColor | color.RGBA |
| image.RGBA64Color | color.RGBA64 |
| image.NRGBAColor | color.NRGBA |
| image.NRGBA64Color | color.NRGBA64 |
| image.AlphaColor | color.Alpha |
| image.Alpha16Color | color.Alpha16 |
| image.GrayColor | color.Gray |
| image.Gray16Color | color.Gray16 |
| image.RGBAColorModel | color.RGBAModel |
| image.RGBA64ColorModel | color.RGBA64Model |
| image.NRGBAColorModel | color.NRGBAModel |
| image.NRGBA64ColorModel | color.NRGBA64Model |
| image.AlphaColorModel | color.AlphaModel |
| image.Alpha16ColorModel | color.Alpha16Model |
| image.GrayColorModel | color.GrayModel |
| image.Gray16ColorModel | color.Gray16Model |
| ycbcr.RGBToYCbCr | color.RGBToYCbCr |
| ycbcr.YCbCrToRGB | color.YCbCrToRGB |
| ycbcr.YCbCrColorModel | color.YCbCrModel |
| ycbcr.YCbCrColor | color.YCbCr |
| ycbcr.YCbCr | image.YCbCr |
| ycbcr.SubsampleRatio444 | image.YCbCrSubsampleRatio444 |
| ycbcr.SubsampleRatio422 | image.YCbCrSubsampleRatio422 |
| ycbcr.SubsampleRatio420 | image.YCbCrSubsampleRatio420 |
| image.ColorImage | image.Uniform |
The image package's New
functions
(NewRGBA
,
NewRGBA64
, etc.)
take an image.Rectangle
as an argument
instead of four integers.
Finally, there are new predefined color.Color
variables
color.Black
,
color.White
,
color.Opaque
and
color.Transparent
.
Updating:
Running go
fix
will update almost all code affected by the change.
In Go 1, the syslog.NewLogger
function returns an error as well as a log.Logger
.
Updating: What little code is affected will be caught by the compiler and must be updated by hand.
In Go 1, the FormatMediaType
function
of the mime
package has been simplified to make it
consistent with
ParseMediaType
.
It now takes "text/html"
rather than "text"
and "html"
.
Updating: What little code is affected will be caught by the compiler and must be updated by hand.
In Go 1, the various SetTimeout
,
SetReadTimeout
, and SetWriteTimeout
methods
have been replaced with
SetDeadline
,
SetReadDeadline
, and
SetWriteDeadline
,
respectively. Rather than taking a timeout value in nanoseconds that
apply to any activity on the connection, the new methods set an
absolute deadline (as a time.Time
value) after which
reads and writes will time out and no longer block.
There are also new functions
net.DialTimeout
to simplify timing out dialing a network address and
net.ListenMulticastUDP
to allow multicast UDP to listen concurrently across multiple listeners.
The net.ListenMulticastUDP
function replaces the old
JoinGroup
and LeaveGroup
methods.
Updating: Code that uses the old methods will fail to compile and must be updated by hand. The semantic change makes it difficult for the fix tool to update automatically.
The Time
function has been removed; callers should use
the Time
type from the
time
package.
The Exec
function has been removed; callers should use
Exec
from the syscall
package, where available.
The ShellExpand
function has been renamed to ExpandEnv
.
The NewFile
function
now takes a uintptr
fd, instead of an int
.
The Fd
method on files now
also returns a uintptr
.
There are no longer error constants such as EINVAL
in the os
package, since the set of values varied with
the underlying operating system. There are new portable functions like
IsPermission
to test common error properties, plus a few new error values
with more Go-like names, such as
ErrPermission
and
ErrNoEnv
.
The Getenverror
function has been removed. To distinguish
between a non-existent environment variable and an empty string,
use os.Environ
or
syscall.Getenv
.
The Process.Wait
method has
dropped its option argument and the associated constants are gone
from the package.
Also, the function Wait
is gone; only the method of
the Process
type persists.
The Waitmsg
type returned by
Process.Wait
has been replaced with a more portable
ProcessState
type with accessor methods to recover information about the
process.
Because of changes to Wait
, the ProcessState
value always describes an exited process.
Portability concerns simplified the interface in other ways, but the values returned by the
ProcessState.Sys
and
ProcessState.SysUsage
methods can be type-asserted to underlying system-specific data structures such as
syscall.WaitStatus
and
syscall.Rusage
on Unix.
Updating:
Running go
fix
will drop a zero argument to Process.Wait
.
All other changes will be caught by the compiler and must be updated by hand.
Go 1 redefines the os.FileInfo
type,
changing it from a struct to an interface:
type FileInfo interface { Name() string // base name of the file Size() int64 // length in bytes Mode() FileMode // file mode bits ModTime() time.Time // modification time IsDir() bool // abbreviation for Mode().IsDir() Sys() interface{} // underlying data source (can return nil) }
The file mode information has been moved into a subtype called
os.FileMode
,
a simple integer type with IsDir
, Perm
, and String
methods.
The system-specific details of file modes and properties such as (on Unix)
i-number have been removed from FileInfo
altogether.
Instead, each operating system's os
package provides an
implementation of the FileInfo
interface, which
has a Sys
method that returns the
system-specific representation of file metadata.
For instance, to discover the i-number of a file on a Unix system, unpack
the FileInfo
like this:
fi, err := os.Stat("hello.go") if err != nil { log.Fatal(err) } // Check that it's a Unix file. unixStat, ok := fi.Sys().(*syscall.Stat_t) if !ok { log.Fatal("hello.go: not a Unix file") } fmt.Printf("file i-number: %d\n", unixStat.Ino)
Assuming (which is unwise) that "hello.go"
is a Unix file,
the i-number expression could be contracted to
fi.Sys().(*syscall.Stat_t).Ino
The vast majority of uses of FileInfo
need only the methods
of the standard interface.
The os
package no longer contains wrappers for the POSIX errors
such as ENOENT
.
For the few programs that need to verify particular error conditions, there are
now the boolean functions
IsExist
,
IsNotExist
and
IsPermission
.
f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) if os.IsExist(err) { log.Printf("%s already exists", name) }
Updating:
Running go
fix
will update code that uses the old equivalent of the current os.FileInfo
and os.FileMode
API.
Code that needs system-specific file details will need to be updated by hand.
Code that uses the old POSIX error values from the os
package
will fail to compile and will also need to be updated by hand.
The os/signal
package in Go 1 replaces the
Incoming
function, which returned a channel
that received all incoming signals,
with the selective Notify
function, which asks
for delivery of specific signals on an existing channel.
Updating: Code must be updated by hand. A literal translation of
c := signal.Incoming()
is
c := make(chan os.Signal) signal.Notify(c) // ask for all signals
but most code should list the specific signals it wants to handle instead:
c := make(chan os.Signal) signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
In Go 1, the Walk
function of the
path/filepath
package
has been changed to take a function value of type
WalkFunc
instead of a Visitor
interface value.
WalkFunc
unifies the handling of both files and directories.
type WalkFunc func(path string, info os.FileInfo, err error) error
The WalkFunc
function will be called even for files or directories that could not be opened;
in such cases the error argument will describe the failure.
If a directory's contents are to be skipped,
the function should return the value filepath.SkipDir
markFn := func(path string, info os.FileInfo, err error) error {
if path == "pictures" { // Will skip walking of directory pictures and its contents.
return filepath.SkipDir
}
if err != nil {
return err
}
log.Println(path)
return nil
}
err := filepath.Walk(".", markFn)
if err != nil {
log.Fatal(err)
}
Updating: The change simplifies most code but has subtle consequences, so affected programs will need to be updated by hand. The compiler will catch code using the old interface.
The regexp
package has been rewritten.
It has the same interface but the specification of the regular expressions
it supports has changed from the old "egrep" form to that of
RE2.
Updating: Code that uses the package should have its regular expressions checked by hand.
In Go 1, much of the API exported by package
runtime
has been removed in favor of
functionality provided by other packages.
Code using the runtime.Type
interface
or its specific concrete type implementations should
now use package reflect
.
Code using runtime.Semacquire
or runtime.Semrelease
should use channels or the abstractions in package sync
.
The runtime.Alloc
, runtime.Free
,
and runtime.Lookup
functions, an unsafe API created for
debugging the memory allocator, have no replacement.
Before, runtime.MemStats
was a global variable holding
statistics about memory allocation, and calls to runtime.UpdateMemStats
ensured that it was up to date.
In Go 1, runtime.MemStats
is a struct type, and code should use
runtime.ReadMemStats
to obtain the current statistics.
The package adds a new function,
runtime.NumCPU
, that returns the number of CPUs available
for parallel execution, as reported by the operating system kernel.
Its value can inform the setting of GOMAXPROCS
.
The runtime.Cgocalls
and runtime.Goroutines
functions
have been renamed to runtime.NumCgoCall
and runtime.NumGoroutine
.
Updating:
Running go
fix
will update code for the function renamings.
Other code will need to be updated by hand.
In Go 1, the
strconv
package has been significantly reworked to make it more Go-like and less C-like,
although Atoi
lives on (it's similar to
int(ParseInt(x, 10, 0))
, as does
Itoa(x)
(FormatInt(int64(x), 10)
).
There are also new variants of some of the functions that append to byte slices rather than
return strings, to allow control over allocation.
This table summarizes the renamings; see the package documentation for full details.
| Old call | New call |
|---|---|
| Atob(x) | ParseBool(x) |
| Atof32(x) | ParseFloat(x, 32)§ |
| Atof64(x) | ParseFloat(x, 64) |
| AtofN(x, n) | ParseFloat(x, n) |
| Atoi(x) | Atoi(x) |
| Atoi(x) | ParseInt(x, 10, 0)§ |
| Atoi64(x) | ParseInt(x, 10, 64) |
| Atoui(x) | ParseUint(x, 10, 0)§ |
| Atoui64(x) | ParseUint(x, 10, 64) |
| Btoi64(x, b) | ParseInt(x, b, 64) |
| Btoui64(x, b) | ParseUint(x, b, 64) |
| Btoa(x) | FormatBool(x) |
| Ftoa32(x, f, p) | FormatFloat(float64(x), f, p, 32) |
| Ftoa64(x, f, p) | FormatFloat(x, f, p, 64) |
| FtoaN(x, f, p, n) | FormatFloat(x, f, p, n) |
| Itoa(x) | Itoa(x) |
| Itoa(x) | FormatInt(int64(x), 10) |
| Itoa64(x) | FormatInt(x, 10) |
| Itob(x, b) | FormatInt(int64(x), b) |
| Itob64(x, b) | FormatInt(x, b) |
| Uitoa(x) | FormatUint(uint64(x), 10) |
| Uitoa64(x) | FormatUint(x, 10) |
| Uitob(x, b) | FormatUint(uint64(x), b) |
| Uitob64(x, b) | FormatUint(x, b) |
Updating:
Running go
fix
will update almost all code affected by the change.
§ Atoi
persists but Atoui
and Atof32
do not, so
they may require
a cast that must be added by hand; the go
fix
tool will warn about it.
The template
and exp/template/html
packages have moved to
text/template
and
html/template
.
More significant, the interface to these packages has been simplified.
The template language is the same, but the concept of "template set" is gone
and the functions and methods of the packages have changed accordingly,
often by elimination.
Instead of sets, a Template
object
may contain multiple named template definitions,
in effect constructing
name spaces for template invocation.
A template can invoke any other template associated with it, but only those
templates associated with it.
The simplest way to associate templates is to parse them together, something
made easier with the new structure of the packages.
Updating:
The imports will be updated by fix tool.
Single-template uses will be otherwise be largely unaffected.
Code that uses multiple templates in concert will need to be updated by hand.
The examples in
the documentation for text/template
can provide guidance.
The testing package has a type, B
, passed as an argument to benchmark functions.
In Go 1, B
has new methods, analogous to those of T
, enabling
logging and failure reporting.
func BenchmarkSprintf(b *testing.B) {
// Verify correctness before running benchmark.
b.StopTimer()
got := fmt.Sprintf("%x", 23)
const expect = "17"
if expect != got {
b.Fatalf("expected %q; got %q", expect, got)
}
b.StartTimer()
for i := 0; i < b.N; i++ {
fmt.Sprintf("%x", 23)
}
}
Updating:
Existing code is unaffected, although benchmarks that use println
or panic
should be updated to use the new methods.
The testing/script package has been deleted. It was a dreg.
Updating: No code is likely to be affected.
In Go 1, the functions
unsafe.Typeof
, unsafe.Reflect
,
unsafe.Unreflect
, unsafe.New
, and
unsafe.NewArray
have been removed;
they duplicated safer functionality provided by
package reflect
.
Updating:
Code using these functions must be rewritten to use
package reflect
.
The changes to encoding/gob and the protocol buffer library
may be helpful as examples.
In Go 1 several fields from the url.URL
type
were removed or replaced.
The String
method now
predictably rebuilds an encoded URL string using all of URL
's
fields as necessary. The resulting string will also no longer have
passwords escaped.
The Raw
field has been removed. In most cases the String
method may be used in its place.
The old RawUserinfo
field is replaced by the User
field, of type *net.Userinfo
.
Values of this type may be created using the new net.User
and net.UserPassword
functions. The EscapeUserinfo
and UnescapeUserinfo
functions are also gone.
The RawAuthority
field has been removed. The same information is
available in the Host
and User
fields.
The RawPath
field and the EncodedPath
method have
been removed. The path information in rooted URLs (with a slash following the
schema) is now available only in decoded form in the Path
field.
Occasionally, the encoded data may be required to obtain information that
was lost in the decoding process. These cases must be handled by accessing
the data the URL was built from.
URLs with non-rooted paths, such as "mailto:dev@golang.org?subject=Hi"
,
are also handled differently. The OpaquePath
boolean field has been
removed and a new Opaque
string field introduced to hold the encoded
path for such URLs. In Go 1, the cited URL parses as:
URL{ Scheme: "mailto", Opaque<EMAIL_ADDRESS>RawQuery: "subject=Hi", }
A new RequestURI
method was
added to URL
.
The ParseWithReference
function has been renamed to ParseWithFragment
.
Updating: Code that uses the old fields will fail to compile and must be updated by hand. The semantic changes make it difficult for the fix tool to update automatically.
 The go
command
does away with makefiles, instead using Go source code to find dependencies and
determine build conditions. Most existing Go programs will no longer require
makefiles to be built.
See How to Write Go Code for a primer on the
go
command and the go command documentation
for the full details.
Updating:
Projects that depend on the Go project's old makefile-based build
infrastructure (Make.pkg
, Make.cmd
, and so on) should
switch to using the go
command for building Go code and, if
necessary, rewrite their makefiles to perform any auxiliary build tasks.
In Go 1, the cgo command
uses a different _cgo_export.h
file, which is generated for packages containing //export
lines.
The _cgo_export.h
file now begins with the C preamble comment,
so that exported function definitions can use types defined there.
This has the effect of compiling the preamble multiple times, so a
package using //export
must not put function definitions
or variable initializations in the C preamble.
One of the most significant changes associated with Go 1 is the availability of prepackaged, downloadable distributions. They are available for many combinations of architecture and operating system (including Windows) and the list will grow. Installation details are described on the Getting Started page, while the distributions themselves are listed on the downloads page.


synchronized
statements.
It is recommended to avoid nested synchronization if possible, because in some cases it may lead to a deadlock.
Example:
synchronized (lockA){
//thread 1 is waiting for lockB
synchronized (lockB){ //warning
}
}
...
synchronized (lockB) {
//thread 2 is waiting for lockA
synchronized (lockA) { //warning
}
}


Re: JaCoCo and Aspectj
Did anybody have a valid pom.xml to use jacoco within an aspectJ project?
Am Dienstag, 23. Juli 2013 01:53:07 UTC+2 schrieb<EMAIL_ADDRESS>> Hi Marc,
>
>
>
> thanks again for your reply.
>
>
>
> I think AspectJ doesn't change the name of the class, but actually creates those additional classes to
serve as support for AOP advices. If I set a breakpoint in a method of that class, during the build I can see it
is still reached and the call trace looks something like this:
>
>
>
> METHOD_NAME_aroundBody0():76, CLASS_NAME
>
> run():1, CLASS_NAME$AjcClosure1
>
>
>
> ... (aspect methods)
>
>
>
> METHOD_NAME():76, CLASS_NAME
>
> TEST_NAME
>
>
>
> so both the AjcClosure and the actual class are present and called.
>
>
>
> Today I've tried to use offline instrumentation and it appears to have solved the problem. I know this is
not the recommended approach and that it introduces additional issues, like not being able to run a maven
test-goal-only phase after a failed test goal without manually running the
restore-instrumented-classes goal; but I think I will have to use it while the run time instrumentation
doesn't work (or if it is actually impossible to do the same thing with run time instrumentation).
>
>
>
> Thanks,
>
> André.
>
>
>
>
>
> On Monday, July 22, 2013 8:43:31 AM UTC+1, Marc R. Hoffmann wrote:
>
> > Hi André,
>
> >
>
> >
>
> >
>
> > if AspectJ replaces classes with other differently named classes things
>
> >
>
> > get tricky. As you already proposed you might try to dump these extra
>
> >
>
> > classes and create a report including those classes (although the
>
> >
>
> > original class probably still renders at not covered). I'm not a Maven
>
> >
>
> > expert but a possible setup might look like this:
>
> >
>
> >
>
> >
>
> > 1) Backup original classes in target/classes
>
> >
>
> > 2) specify classDumpDir for the prepare-agent goal to dump classes to
>
> >
>
> > target/classes
>
> >
>
> > 2) Create JaCoCo report
>
> >
>
> > 3) Restore target/classes from backup
>
> >
>
> >
>
> >
>
> > See documentation of JaCoCo Maven goals:
>
> >
>
> > http://www.eclemma.org/jacoco/trunk/doc/maven.html
>
> >
>
> >
>
> >
>
> > Cheers,
>
> >
>
> > -marc
>
> >
>
> >
>
> >
>
> > On 2013-07-21 18:42, André Pinto wrote:
>
> >
>
> > > Hi Marc,
>
> >
>
> > >
>
> >
>
> > > thanks for replying so quickly.
>
> >
>
> > >
>
> >
>
> > > Right now I'm only testing a specific problematic class in order to
>
> >
>
> > > perform faster clean install iterations while trying different
>
> >
>
> > > approaches.
>
> >
>
> > >
>
> >
>
> > > The class that I'm testing does not appear on the Sessions page when
>
> >
>
> > > I
>
> >
>
> > > have AspectJ weaver agent enabled. In its place there are two
>
> >
>
> > > AjcClosure classes from AspectJ:
>
> >
>
> > >
>
> >
>
> > > CLASS_NAME.AjcClosure1 8b30d747616523a0
>
> >
>
> > > CLASS_NAME.AjcClosure3 b62aad26ee5ff4eb
>
> >
>
> > > CLASS_NAME.Result [nested class with link] 27ec6335c32de676
>
> >
>
> > > CLASS_NAMEIntTest c508b26e62564a2b
>
> >
>
> > > CLASS_NAMETest d101cb5455c0b79d
>
> >
>
> > > CLASS_NAMETest.TestDelegate 89770d1905c6d466
>
> >
>
> > >
>
> >
>
> > > When not using AspectJ LTW the class appears in the session page (I
>
> >
>
> > > needed to comment the tests that used AOP for this to work so the
>
> >
>
> > > nested class does not appear now):
>
> >
>
> > >
>
> >
>
> > > CLASS_NAME [with link] 9be84e8927495ca6
>
> >
>
> > > CLASS_NAMEIntTest 6e56338794a364f2
>
> >
>
> > > CLASS_NAMETest d101cb5455c0b79d
>
> >
>
> > > CLASS_NAMETest.TestDelegate 89770d1905c6d466
>
> >
>
> > >
>
> >
>
> > > This is my Jacoco Maven plugin configuration:
>
> >
>
> > >
>
> >
>
> > > <plugin>
>
> >
>
> > > <groupId>org.jacoco</groupId>
>
> >
>
> > > <artifactId>jacoco-maven-plugin</artifactId>
>
> >
>
> > > <version><IP_ADDRESS>306030806</version>
>
> >
>
> > > <configuration>
>
> >
>
> > > <propertyName>coverageAgent</propertyName>
>
> >
>
> > > <skip>false</skip>
>
> >
>
> > > <excludes>
>
> >
>
> > > EXCLUDES LIST
>
> >
>
> > > </excludes>
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > <classDumpDir>${basedir}/target/jacoco-classes</classDumpDir>
>
> >
>
> > > </configuration>
>
> >
>
> > >
>
> >
>
> > > <executions>
>
> >
>
> > > <execution>
>
> >
>
> > > <id>prepare-agent</id>
>
> >
>
> > > <goals>
>
> >
>
> > > <goal>prepare-agent</goal>
>
> >
>
> > > </goals>
>
> >
>
> > > </execution>
>
> >
>
> > > <execution>
>
> >
>
> > > <id>report</id>
>
> >
>
> > > <phase>prepare-package</phase>
>
> >
>
> > > <goals>
>
> >
>
> > > <goal>report</goal>
>
> >
>
> > > </goals>
>
> >
>
> > > </execution>
>
> >
>
> > > <execution>
>
> >
>
> > > <id>check</id>
>
> >
>
> > > <goals>
>
> >
>
> > > <goal>check</goal>
>
> >
>
> > > </goals>
>
> >
>
> > > <configuration>
>
> >
>
> > > <rules>
>
> >
>
> > > RULES LIST
>
> >
>
> > > </rules>
>
> >
>
> > > </configuration>
>
> >
>
> > > </execution>
>
> >
>
> > > </executions>
>
> >
>
> > > </plugin>
>
> >
>
> > >
>
> >
>
> > > and my Maven Surefire plugin configuration:
>
> >
>
> > >
>
> >
>
> > > <plugin>
>
> >
>
> > > <groupId>org.apache.maven.plugins</groupId>
>
> >
>
> > > <artifactId>maven-surefire-plugin</artifactId>
>
> >
>
> > > <version>2.15</version>
>
> >
>
> > >
>
> >
>
> > > <configuration>
>
> >
>
> > > <groups>specific_test_group</groups>
>
> >
>
> > > <argLine>-Xmx1024m -XX:MaxPermSize=256m ${coverageAgent}
>
> >
>
> > > -javaagent:"${aspectj.agent.jar}"</argLine>
>
> >
>
> > > <properties>
>
> >
>
> > > <property>
>
> >
>
> > > <name>listener</name>
>
> >
>
> > > <value>SOME_TESTNG_LISTENERS</value>
>
> >
>
> > > </property>
>
> >
>
> > > </properties>
>
> >
>
> > > </configuration>
>
> >
>
> > > </plugin>
>
> >
>
> > >
>
> >
>
> > > Thanks,
>
> >
>
> > >
>
> >
>
> > > André
>
> >
>
> > >
>
> >
>
> > > On Sun, Jul 21, 2013 at 4:58 PM, Marc R. Hoffmann
>
> >
>
> > ><EMAIL_ADDRESS>[10]> wrote:
>
> >
>
> > >
>
> >
>
> > >> Hi André,
>
> >
>
> > >>
>
> >
>
> > >> this strange. If the JaCoCo agent really is the very first agent in
>
> >
>
> > >> the command line it should see the class files (or JARs) from the
>
> >
>
> > >> file system. So if the report is created based on the exact same
>
> >
>
> > >> file the report should show coverage for all executed classes.
>
> >
>
> > >>
>
> >
>
> > >> In the JaCoCo HTML report can you please check whether the classes
>
> >
>
> > >> in question are listed on the sessions page (link in the top right
>
> >
>
> > >> corner).
>
> >
>
> > >>
>
> >
>
> > >> Thanks,
>
> >
>
> > >> -marc
>
> >
>
> > >>
>
> >
>
> > >> On 20.07.13 19:03<EMAIL_ADDRESS>[6] wrote:
>
> >
>
> > >>
>
> >
>
> > >>> Hi,
>
> >
>
> > >>>
>
> >
>
> > >>> I'm using Java 1.7, AspectJ 1.7.3 (for load-time weaving), Jacoco
>
> >
>
> > >>> Maven plugin <IP_ADDRESS>306030806 and Maven Surefire Plugin 2.15 to
>
> >
>
> > >>> run the tests. In these conditions Jacoco doesn't work correctly.
>
> >
>
> > >>>
>
> >
>
> > >>> If Jacoco's Java agent is set as the second Java agent (after
>
> >
>
> > >>> AspectJ weaver agent), the build produces these errors:
>
> >
>
> > >>>
>
> >
>
> > >>> java.lang.instrument.IllegalClassFormatException: Error while
>
> >
>
> > >>> instrumenting class CLASS_NAME.
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.CoverageTransformer.transform(CoverageTransformer.java:89)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > sun.instrument.TransformerManager.transform(TransformerManager.java:188)
>
> >
>
> > >>> ...
>
> >
>
> > >>> Caused by: java.io.IOException: Error while instrumenting class
>
> >
>
> > >>> CLASS_NAME.
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrumentError(Instrumenter.java:147)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrument(Instrumenter.java:98)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.CoverageTransformer.transform(CoverageTransformer.java:87)
>
> >
>
> > >>> ... 64 more
>
> >
>
> > >>> Caused by: java.lang.IllegalStateException: Missing or invalid
>
> >
>
> > >>> stackmap frames.
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.internal.instr.FrameTracker.assertValidFrames(FrameTracker.java:613)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.internal.instr.FrameTracker.pop(FrameTracker.java:602)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.internal.instr.FrameTracker.visitVarInsn(FrameTracker.java:386)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.asm.MethodVisitor.visitVarInsn(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.asm.MethodVisitor.visitVarInsn(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.asm.tree.VarInsnNode.accept(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.asm.tree.InsnList.accept(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.asm.tree.MethodNode.accept(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.internal.flow.ClassProbesAdapter$1.visitEnd(ClassProbesAdapter.java:124)
>
> >
>
> > >>> at
>
> >
>
> > >>> org.jacoco.agent.rt.internal_9dd1198.asm.ClassReader.b(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >> org.jacoco.agent.rt.internal_9dd1198.asm.ClassReader.accept(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >> org.jacoco.agent.rt.internal_9dd1198.asm.ClassReader.accept(Unknown
>
> >
>
> > >>> Source)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrument(Instrumenter.java:78)
>
> >
>
> > >>> at
>
> >
>
> > >>>
>
> >
>
> > >>
>
> >
>
> > >
>
> >
>
> > > org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrument(Instrumenter.java:96)
>
> >
>
> > >>> ... 65 more
>
> >
>
> > >>>
>
> >
>
> > >>> if it is set as the first Java Agent (before AspectJ) it works
>
> >
>
> > >>> for most classes, but fails to produce correct coverage reports
>
> >
>
> > >>> for weaved classes (all the lines appear as not covered even
>
> >
>
> > >>> though I have tests covering them).
>
> >
>
> > >>>
>
> >
>
> > >>> I tried to use the classdumpdir solution presented here:
>
> >
>
> > >>> https://github.com/jacoco/eclemma/issues/33 [5] but I can't find a
>
> >
>
> > >>> equivalent Maven configuration for the setting the check and
>
> >
>
> > >>> report Jacoco goals to use the classdumpdir directory.
>
> >
>
> > >>>
>
> >
>
> > >>> Does anyone have a solution for this?
>
> >
>
> > >>>
>
> >
>
> > >>> Thanks,
>
> >
>
> > >>> André.
>
> >
>
> > >>>
>
> >
>
> > >>> On Wednesday, March 6, 2013 8:52:36 AM UTC, Erik Vande Velde
>
> >
>
> > >>> wrote:
>
> >
>
> > >>>
>
> >
>
> > >>>> Hi Henrik,
>
> >
>
> > >>>>
>
> >
>
> > >>>> This did indeed solve my problem, thanks !!!
>
> >
>
> > >>>>
>
> >
>
> > >>>> 2013/3/6 Henrik Horneber<EMAIL_ADDRESS>[1]>
>
> >
>
> > >>>>
>
> >
>
> > >>>> Hi,
>
> >
>
> > >>>>
>
> >
>
> > >>>> I've successfully used JaCoCo together with AspectJ.
>
> >
>
> > >>>>
>
> >
>
> > >>>> You need to make sure
>
> >
>
> > >>>>
>
> >
>
> > >>>> * you use AspectJ version >= 1.7
>
> >
>
> > >>>>
>
> >
>
> > >>>> * java source and target are also set to 1.7
>
> >
>
> > >>>>
>
> >
>
> > >>>> Then AspectJ will generate class files JaCoCo can use.
>
> >
>
> > >>>>
>
> >
>
> > >>>> Best regards,
>
> >
>
> > >>>>
>
> >
>
> > >>>> Henrik
>
> >
>
> > >>>>
>
> >
>
> > >>>> On Wed, Mar 6, 2013 at 8:02 AM, Erik Vande Velde
>
> >
>
> > >>>><EMAIL_ADDRESS>[2]> wrote:
>
> >
>
> > >>>>
>
> >
>
> > >>>> Hello Marc,
>
> >
>
> > >>>>
>
> >
>
> > >>>> Thanks for your reaction! I'll put your question on the Aspectj
>
> >
>
> > >>>> forum today.
>
> >
>
> > >>>>
>
> >
>
> > >>>> Kind Regards,
>
> >
>
> > >>>> Erik
>
> >
>
> > >>>>
>
> >
>
> > >>>> 2013/3/5 Marc Hoffmann<EMAIL_ADDRESS>[3]>
>
> >
>
> > >>>>
>
> >
>
> > >>>> Hi,
>
> >
>
> > >>>>
>
> >
>
> > >>>> in any case JaCoCo requires valid classfiles as input. This
>
> >
>
> > >>>> implies that class files from version 1.6 on need to contain
>
> >
>
> > >>>> valid stackmap frames. If this is not the case JaCoCo will fail
>
> >
>
> > >>>> with exactly this message.
>
> >
>
> > >>>>
>
> >
>
> > >>>> Have you reported the problem to AspectJ?
>
> >
>
> > >>>>
>
> >
>
> > >>>> Best regards,
>
> >
>
> > >>>>
>
> >
>
> > >>>> -marc
>
> >
>
> > >>>>
>
> >
>
> > >>>> On 2013-03-05 16:50<EMAIL_ADDRESS>[4] wrote:
>
> >
>
> > >>>>
>
> >
>
> > >>>> I downloaded JaCoCo today, and got the ant + maven examples
>
> >
>
> > >>>> going
>
> >
>
> > >>>>
>
> >
>
> > >>>> immediately.
>
> >
>
> > >>>>
>
> >
>
> > >>>> But when I change the pom.xml of our project in a similar way
>
> >
>
> > >>>> as the
>
> >
>
> > >>>>
>
> >
>
> > >>>> examples I'm in trouble, almost certainly because we use
>
> >
>
> > >>>> Aspectj in
>
> >
>
> > >>>>
>
> >
>
> > >>>> that project:
>
> >
>
> > >>>>
>
> >
>
> > >>>> 1) offline modus:
>
> >
>
> > >>>>
>
> >
>
> > >>>> Here I get the following error message:
>
> >
>
> > >>>>
>
> >
>
> > >>>> [ERROR] Failed to execute goal
>
> >
>
> > >>>>
>
> >
>
> > >>>> org.jacoco:jacoco-maven-plugin:<IP_ADDRESS>302030002:instrument
>
> >
>
> > >>>> (default)
>
> >
>
> > >>>>
>
> >
>
> > >>>> on project com.fugro.gwf.server.core: Execution default of
>
> >
>
> > >>>> goal
>
> >
>
> > >>>>
>
> >
>
> > >>>> org.jacoco:jacoco-maven-plugin:<IP_ADDRESS>302030002:instrument
>
> >
>
> > >>>> failed:
>
> >
>
> > >>>>
>
> >
>
> > >>>> Missing or invalid stackmap frames. -> [Help 1]
>
> >
>
> > >>>>
>
> >
>
> > >>>> 2) on the fly modus:
>
> >
>
> > >>>>
>
> >
>
> > >>>> Running
>
> >
>
> > >>>> com.fugro.gwf.server.core.synchronisation.Synchronise1Test
>
> >
>
> > >>>>
>
> >
>
> > >>>> Start java.lang.instrument.IllegalClassFormatException:
>
> >
>
> > >>>>
>
> >
>
> > >>>> Error while instrumenting class
>
> >
>
> > >>>>
>
> >
>
> > >>>> com/fugro/gwf/server/core/referencing/ReferencingAspect.
>
> >
>
> > >>>>
>
> >
>
> > >>>> Underneath this message the stack trace once more shows:
>
> >
>
> > >>>>
>
> >
>
> > >>>> Caused by: java.lang.IllegalStateException: Missing or invalid
>
> >
>
> > >>>>
>
> >
>
> > >>>> stackmap frames.
>
> >
>
> > >>>>
>
> >
>
> > >>>> My questions:
>
> >
>
> > >>>>
>
> >
>
> > >>>> 1) Is there a way to get coverage information for an aspectj
>
> >
>
> > >>>> project
>
> >
>
> > >>>>
>
> >
>
> > >>>> in JaCoCo?
>
> >
>
> > >>>>
>
> >
>
> > >>>> 2) If not, do you know an alternative tool that can deal with
>
> >
>
> > >>>> aspectj
>
> >
>
> > >>>>
>
> >
>
> > >>>> projects. I tried clover, but they simply say they don't
>
> >
>
> > >>>> support
>
> >
>
> > >>>>
>
> >
>
> > >>>> aspectj projects. I also tried Coburtera and emma, but assumed
>
> >
>
> > >>>> JaCoCo
>
> >
>
> > >>>>
>
> >
>
> > >>>> is a more recent (and better supported) tool
>
> >
>
> > >>
>
> >
>
> > >> --
>
> >
>
> > >> You received this message because you are subscribed to a topic in
>
> >
>
> > >> the Google Groups "JaCoCo and EclEmma Users" group.
>
> >
>
> > >>
>
> >
>
> > >> To unsubscribe from this topic, visit
>
> >
>
> > >> https://groups.google.com/d/topic/jacoco/Zb_MOFXIUn0/unsubscribe
>
> >
>
> > >> [7].
>
> >
>
> > >> To unsubscribe from this group and all its topics, send an email to
>
> >
>
> > >><EMAIL_ADDRESS>[8].
>
> >
>
> > >> For more options, visit https://groups.google.com/groups/opt_out
>
> >
>
> > >> [9].
>
> >
>
> > >
>
> >
>
> > > --
>
> >
>
> > > You received this message because you are subscribed to the Google
>
> >
>
> > > Groups "JaCoCo and EclEmma Users" group.
>
> >
>
> > > To unsubscribe from this group and stop receiving emails from it,
>
> >
>
> > > send an email to<EMAIL_ADDRESS>>
> >
>
> > > For more options, visit https://groups.google.com/groups/opt_out
>
> >
>
> > > [11].
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Links:
>
> >
>
> > > ------
>
> >
>
> > > [1]<EMAIL_ADDRESS>>
> >
>
> > > [2]<EMAIL_ADDRESS>>
> >
>
> > > [3]<EMAIL_ADDRESS>>
> >
>
> > > [4]<EMAIL_ADDRESS>>
> >
>
> > > [5] https://github.com/jacoco/eclemma/issues/33
>
> >
>
> > > [6]<EMAIL_ADDRESS>>
> >
>
> > > [7] https://groups.google.com/d/topic/jacoco/Zb_MOFXIUn0/unsubscribe
>
> >
>
> > > [8]<EMAIL_ADDRESS>>
> >
>
> > > [9] https://groups.google.com/groups/opt_out
>
> >
>
> > > [10]<EMAIL_ADDRESS>>
> >
>
> > > [11] https://groups.google.com/groups/opt_out
--
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to<EMAIL_ADDRESS>For more options, visit https://groups.google.com/groups/opt_out.