Fox’s cancellation of “Brooklyn Nine-Nine” came as a shock to many of the show’s fans, but showrunner Dan Goor suspected that the writing might be on the wall far sooner.

Goor told TheWrap Tuesday night that if the wedding at the end of Season 5 turned out to be the series finale, he wouldn’t have been disappointed.

“We sort of had this feeling there was a chance,” he said on TheWrap’s Outstanding Showrunner Comedy Panel at the Landmark Theatres in Los Angeles Tuesday. “The year before we had Jake and Rosa wrongly convicted and sent to prison, and it would’ve been such a weird F-U to the audience. Then we did a wedding, and I would not have been disappointed if it had been the series finale, but it wasn’t really what I felt like the show was about.”

Also Read: 'Friends' Reunion Will 'Never' Happen, But Ross and Rachel Are Still Together, Co-Creator Says (Exclusive)

Goor previously worked as a writer on “Parks and Recreation,” and he said “Brooklyn Nine-Nine” was in a way a “reaction” to working on that show. If you had an “environmental impact report” on “Parks,” you had to spend two minutes explaining what that was, but “Brooklyn” represented a change of pace from that writing challenge.

“There were certain things about ‘Parks and Rec’ that we loved but had always been difficult when we were writing it,” Goor said. “We kind of felt like, the language of a police show is just so clear, so we can start on a shot of the 99th Precinct, tilt down, Jake can come in and go, ‘Someone got murdered,’ and you go, ‘Oh, they’re solving a murder.'”

Working on “Parks and Rec” also got Goor in the habit of writing season finales that could double as a series finale. But during development of Season 5 of “Brooklyn Nine-Nine,” Goor changed his expectations.

Also Read: 'Parks and Rec' Reunion: Amy Poehler Says 'We Would All Do It' (Video)

“I’d say the middle 10 episodes while we were breaking them, I was a real wreck, I was putting so much pressure on it,” Goor said. “I changed the expectations for the room from, let’s plan on this being the series finale, but also be sure that it could lead into a great Season 6, to, if this was the end, no one would be disappointed.”

Thankfully, NBC did salvage “Brooklyn Nine-Nine” for its sixth season, with the show additionally moving from a 22-episode order to just 13 episodes. But we wouldn’t have minded if Season 5’s wedding turned out to be the end either.

Goor appeared on TheWrap’s Outstanding Showrunner Comedy Panel with David Crane and Jeffrey Klarik of “Episodes” and Rachel Bloom and Aline Brosh McKenna of “Crazy Ex-Girlfriend.” Watch a video from the panel discussion above.