why didn't Lily and James become each other secret keepers

why didn't they because then they wouldn't be dead because they wouldn't betray each other