Update rsrc.go

Made the for-loop as a separated function